Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 58 additions & 15 deletions .github/workflows/dev-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
branches: [ "main" ]
merge_group:

concurrency:
group: ${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true

jobs:
dev-check:
build:
name: Build Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
Expand All @@ -20,21 +24,60 @@ jobs:
cache: 'npm'
- name: Install dependencies
run: npm ci
- 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)" ]
- name: Check for circular dependencies
run: npm run circular
- 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
- name: Run unit tests
run: npm run test:coverage
- name: Run unit tests with cockpit
run: npm run test:cockpit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

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:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/junit.xml
verbose: true
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check for manual changes to API
run: |
npm run api:generate
if [ -n "$(git status --porcelain)" ]; then
Comment thread
kingsleyzissou marked this conversation as resolved.
echo
echo "✗ API manually changed, please refer to the README for the procedure to follow for programmatically generated API endpoints."
exit 1
else
echo
echo "✓ No manual API changes."
exit 0
fi
6 changes: 6 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
workflow_dispatch:
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:
playwright-tests:
runs-on:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Unit Tests

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
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:
unit-tests:
name: Service Tests
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 unit tests
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/junit.xml
verbose: true

cockpit-unit-tests:
name: Cockpit Tests
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 unit tests with cockpit
run: npm run test:cockpit
Loading