Skip to content

Chore pre pr check script #1

Chore pre pr check script

Chore pre pr check script #1

Workflow file for this run

# 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