workflows: split out dev checks into jobs

Split out the dev checks into multiple jobs, the benefit of this is that it
will be easier to see which check is failing and why.
This commit is contained in:
Gianluca Zuccarelli 2025-06-27 13:40:07 +01:00 committed by Klara Simickova
parent 9247ea6196
commit eca4e55c67
3 changed files with 75 additions and 10 deletions

View file

@ -7,10 +7,59 @@ on:
branches: [ "main" ] branches: [ "main" ]
merge_group: merge_group:
jobs: concurrency:
dev-check: group: ${{github.workflow}}-${{ github.ref }}
runs-on: ubuntu-latest cancel-in-progress: true
jobs:
build:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run build
run: npm run build
lint-checks:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint check
run: npm run lint
circular-dependencies:
name: Circular Dependencies Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check for circular dependencies
run: npm run circular
api-changes:
name: Manual API Changes Check
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Use Node.js 20 - name: Use Node.js 20
@ -21,10 +70,14 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Check for manual changes to API - name: Check for manual changes to API
run: npm run api:generate && [ -z "$(git status --porcelain=v1 2>/dev/null)" ] && echo "✓ No manual API changes." || echo "✗ API manually changed, please refer to the README for the procedure to follow for programmatically generated API endpoints." && [ -z "$(git status --porcelain=v1 2>/dev/null)" ] run: |
- name: Check for circular dependencies npm run api:generate
run: npm run circular if [ -n "$(git status --porcelain)" ]; then
- name: Run build echo
run: npm run build echo "✗ API manually changed, please refer to the README for the procedure to follow for programmatically generated API endpoints."
- name: Run lint check exit 1
run: npm run lint else
echo
echo "✓ No manual API changes."
exit 0
fi

View file

@ -6,6 +6,12 @@ on:
workflow_dispatch: workflow_dispatch:
merge_group: merge_group:
# this prevents multiple jobs from the same pr
# running when new changes are pushed.
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
playwright-tests: playwright-tests:
runs-on: runs-on:

View file

@ -7,6 +7,12 @@ on:
branches: [ "main" ] branches: [ "main" ]
merge_group: merge_group:
# this prevents multiple jobs from the same pr
# running when new changes are pushed.
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
unit-tests: unit-tests:
name: Service Tests name: Service Tests