Skip to content

feat: update to Angular v22 #1191

feat: update to Angular v22

feat: update to Angular v22 #1191

name: CPS Shared UI Checker
on:
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 24.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run composition unit tests with coverage
run: npm run test:composition
- name: Run library unit tests with coverage
run: npm run test:coverage:cps-ui-kit
- name: Comment coverage on PR
uses: ArtiomTr/jest-coverage-report-action@v2
if: github.event_name == 'pull_request'
continue-on-error: true
with:
custom-title: Coverage report for library
coverage-file: ./coverage/report.json
base-coverage-file: ./coverage/report.json
skip-step: all
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint app
run: npm run lint
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck app
run: npm run typecheck
playwright:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test:playwright
- name: Upload Playwright report
id: upload-report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 10
- name: Upload test results
id: upload-results
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-test-results
path: test-results/
retention-days: 10
- name: Build artifact links
id: artifact-links
if: always()
run: |
REPORT_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload-report.outputs.artifact-id }}"
MSG="For details, download the [Playwright report](${REPORT_URL})"
RESULTS_ID="${{ steps.upload-results.outputs.artifact-id }}"
if [ -n "$RESULTS_ID" ]; then
RESULTS_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${RESULTS_ID}"
MSG="${MSG} | [Test results — screenshots, videos, traces](${RESULTS_URL})"
fi
echo "msg=${MSG}" >> "$GITHUB_OUTPUT"
- name: Playwright report summary
uses: daun/playwright-report-summary@v3
if: always()
with:
report-file: playwright-report/summary.json
comment-title: 'Playwright test results'
job-summary: true
custom-info: ${{ steps.artifact-links.outputs.msg }}
pa11y:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run pa11y accessibility checks
run: npm run test:pa11y:ci
generate-api-data:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Generate API data and check for changes
id: generate-api
run: |
npm run generate-json-api
if [[ -n "$(git status --porcelain projects/composition/src/app/api-data/)" ]]; then
echo "API data has changed. Please commit the updated API data.";
git --no-pager diff projects/composition/src/app/api-data/
exit 1;
else
echo "No changes in API data.";
fi