Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Issue #183] Opportunity Page Design Implementation #164

[Issue #183] Opportunity Page Design Implementation

[Issue #183] Opportunity Page Design Implementation #164

name: pa11y tests
on:
pull_request:
paths:
- frontend/**
- .github/workflows/ci-frontend-a11y.yml
jobs:
build:
name: Pa11y-ci tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
env:
NODE_VERSION: 20
LOCKFILE_PATH: ./frontend/package-lock.json
PACKAGE_MANAGER: npm
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}
- name: Install dependencies
run: npm ci
- name: Create screenshots directory
run: mkdir -p screenshots-output
- name: Build project
run: npm run build
- name: Start server and log output
run: npm run start &
- name: Start API Server for search results
run: |
cd ../api
make init db-seed-local start &
cd ../frontend
# ensure the API wait script is executable
chmod +x ../api/bin/wait-for-api.sh
../api/bin/wait-for-api.sh
shell: bash
- name: Wait for frontend to be ready
run: |
# Ensure the server wait script is executable
chmod +x ./bin/wait-for-frontend.sh
./bin/wait-for-frontend.sh
- name: Run pa11y-ci
run: |
set -e # Ensure the script fails if any command fails
npm run test:pa11y-desktop
npm run test:pa11y-mobile
echo "pa11y-ci tests finished."
- name: Upload screenshots to artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: ./frontend/screenshots-output