Skip to content

feat(api): add /np/constellation endpoint with structured FORRT chain… #238

feat(api): add /np/constellation endpoint with structured FORRT chain…

feat(api): add /np/constellation endpoint with structured FORRT chain… #238

Workflow file for this run

# Run quick checks on PRs/main that span multiple workspaces.
name: Full Monorepo Checks
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
push:
branches: [main]
workflow_dispatch:
description: Check the code and build for all workspaces
env:
NODE_VERSION: "24"
CUSTOM_NANOPUB_JS: false
jobs:
# Only needed when relying on local nanopub-js, not npm package
build-nanopub-js:
if: ${{ vars.CUSTOM_NANOPUB_JS == 'true' }}
uses: ./.github/workflows/build-nanopub-js.yml
with:
node-version: ${{ vars.NODE_VERSION }}
secrets: inherit
install:
name: Install Dependencies
runs-on: ubuntu-latest
needs: build-nanopub-js
if: ${{ !cancelled() && (needs.build-nanopub-js.result == 'success' || needs.build-nanopub-js.result == 'skipped') }}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
if: ${{ vars.CUSTOM_NANOPUB_JS == 'true' }}
with:
name: nanopub-js
path: ../nanopub-js
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
# Build and cache the output of npm install to use in other workflows
- name: Cache node_modules
id: cache-nm
uses: actions/cache@v5
with:
path: |
node_modules
frontend/node_modules
api/node_modules
zotero/node_modules
homepage/node_modules
key: nm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-nm.outputs.cache-hit != 'true'
run: npm ci
frontend-check:
name: Frontend Checks
runs-on: ubuntu-latest
needs: [build-nanopub-js, install]
if: ${{ !cancelled() && (needs.build-nanopub-js.result == 'success' || needs.build-nanopub-js.result == 'skipped') && needs.install.result == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Only needed when relying on local nanopub-js, not npm package
- name: Download nanopub-js artifact
if: ${{ vars.CUSTOM_NANOPUB_JS == 'true' }}
uses: actions/download-artifact@v8
with:
name: nanopub-js
path: ../nanopub-js
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node_modules
uses: actions/cache@v5
with:
path: |
node_modules
frontend/node_modules
api/node_modules
zotero/node_modules
homepage/node_modules
key: nm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Lint
working-directory: ./frontend
run: npm run lint || echo "No lint script configured"
- name: Typecheck
working-directory: ./frontend
run: npm run typecheck
- name: Build
working-directory: ./frontend
run: npm run check
- name: Test
working-directory: ./frontend
run: npm run test
api-check:
name: API Checks
runs-on: ubuntu-latest
needs: [build-nanopub-js, install]
if: ${{ !cancelled() && (needs.build-nanopub-js.result == 'success' || needs.build-nanopub-js.result == 'skipped') && needs.install.result == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Only needed when relying on local nanopub-js, not npm package
- name: Download nanopub-js artifact
if: ${{ vars.CUSTOM_NANOPUB_JS == 'true' }}
uses: actions/download-artifact@v8
with:
name: nanopub-js
path: ../nanopub-js
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node_modules
uses: actions/cache@v5
with:
path: |
node_modules
frontend/node_modules
api/node_modules
zotero/node_modules
homepage/node_modules
key: nm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Lint
working-directory: ./api
run: npm run lint || echo "No lint script configured"
- name: Typecheck
working-directory: ./api
run: npx tsc --noEmit
- name: Copy wrangler config
working-directory: ./api
run: cp wrangler.jsonc.example wrangler.jsonc
- name: Build
working-directory: ./api
run: npm run check
zotero-check:
name: Zotero Checks
runs-on: ubuntu-latest
needs: [build-nanopub-js, install]
if: ${{ !cancelled() && (needs.build-nanopub-js.result == 'success' || needs.build-nanopub-js.result == 'skipped') && needs.install.result == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Only needed when relying on local nanopub-js, not npm package
- name: Download nanopub-js artifact
if: ${{ vars.CUSTOM_NANOPUB_JS == 'true' }}
uses: actions/download-artifact@v8
with:
name: nanopub-js
path: ../nanopub-js
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore node_modules
uses: actions/cache@v5
with:
path: |
node_modules
frontend/node_modules
api/node_modules
zotero/node_modules
homepage/node_modules
key: nm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Lint
working-directory: ./zotero
run: npm run lint:check
- name: Build
working-directory: ./zotero
run: npm run build