Chore pre pr check script #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Runs the same pre-PR check as `npm run check` on every pull request and on main. | |
| # git.ntnu.no has no shared runners, so this needs a self-hosted runner registered for | |
| # this repository (see docs/workflow.md). Until one exists, runs wait as "Queued". | |
| name: Check | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| # A new push to the same pull request cancels the run that is still going. | |
| concurrency: | |
| group: check-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: [self-hosted, t18] | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: | | |
| npm ci --prefix frontend --no-audit --no-fund | |
| npm ci --prefix backend --no-audit --no-fund | |
| - name: Prettier, ESLint, TypeScript, tests with coverage and build | |
| run: npm run check | |
| # The coverage report, downloadable from the run's summary page. | |
| # GitHub Enterprise Server needs the v3 node20 build of upload-artifact. | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v3.2.1-node20 | |
| with: | |
| name: coverage-report | |
| path: frontend/coverage/ | |
| if-no-files-found: ignore | |
| retention-days: 14 |