| name: Frontend |
| |
| on: |
| push: |
| branches: [main, master] |
| paths: |
| - "frontend/**" |
| - ".github/workflows/frontend.yml" |
| pull_request: |
| paths: |
| - "frontend/**" |
| - ".github/workflows/frontend.yml" |
| workflow_dispatch: |
| |
| permissions: |
| contents: read |
| |
| concurrency: |
| group: frontend-${{ github.ref }} |
| cancel-in-progress: true |
| |
| defaults: |
| run: |
| working-directory: frontend |
| |
| jobs: |
| check: |
| name: Types and tests (Node ${{ matrix.node-version }}) |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| node-version: ["20", "22"] |
| steps: |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| |
| - uses: actions/setup-node@v4 |
| with: |
| node-version: ${{ matrix.node-version }} |
| cache: npm |
| cache-dependency-path: frontend/package-lock.json |
| |
| - name: Install dependencies |
| run: npm ci |
| |
| # svelte-check type checks the .svelte files as well as the .ts modules. |
| - name: Type check |
| run: npm run check |
| |
| - name: Unit tests |
| run: npm run test |
| |
| build: |
| name: Build |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| |
| - uses: actions/setup-node@v4 |
| with: |
| node-version: "22" |
| cache: npm |
| cache-dependency-path: frontend/package-lock.json |
| |
| - name: Install dependencies |
| run: npm ci |
| |
| - name: Build |
| run: npm run build |
| |
| - name: Check the build produced something servable |
| run: | |
| test -f dist/index.html |
| test -d dist/assets |
| # The API docs page loads Swagger UI from here rather than a CDN, so |
| # a build without it would ship a broken /docs. |
| test -f dist/vendor/swagger-ui-bundle.js |
| |
| - name: Upload the build |
| uses: actions/upload-artifact@v4 |
| with: |
| name: frontend-dist |
| path: frontend/dist |
| retention-days: 14 |