Asap 178 accessibility audit #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Accessibility Scan | |
| on: | |
| pull_request: | |
| branches: [ main, dev ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:14 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r python_components/accessibility_scan/requirements.txt | |
| - name: Install Firefox and GeckoDriver | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y firefox wget xvfb | |
| sudo rm -rf /var/lib/apt/lists/* | |
| wget -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz | |
| sudo tar -xzf /tmp/geckodriver.tar.gz -C /usr/local/bin/ | |
| sudo chmod +x /usr/local/bin/geckodriver | |
| rm /tmp/geckodriver.tar.gz | |
| - name: Compile CSS and JS | |
| run: | | |
| npm install -g [email protected] [email protected] | |
| yarn install | |
| yarn build | |
| yarn build:css | |
| - name: Set up database | |
| env: | |
| RAILS_ENV: test | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/access_pdf_test | |
| run: | | |
| bundle exec rails db:create | |
| bundle exec rails db:migrate | |
| bundle exec rails db:setup | |
| - name: Start Rails server | |
| env: | |
| RAILS_ENV: test | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/access_pdf_test | |
| run: | | |
| # Start Rails server on a specific port in the background | |
| bin/rails server -e test -p 3000 & | |
| echo $! > rails_server.pid | |
| # Wait for Rails server to be ready | |
| echo "Waiting for Rails server to start..." | |
| timeout=60 | |
| while ! curl -f http://localhost:3000 >/dev/null 2>&1; do | |
| sleep 2 | |
| timeout=$((timeout - 2)) | |
| if [ $timeout -le 0 ]; then | |
| echo "Rails server failed to start within 60 seconds" | |
| exit 1 | |
| fi | |
| done | |
| echo "Rails server is ready!" | |
| - name: Run Accessibility Scan | |
| env: | |
| RAILS_ENV: test | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/access_pdf_test | |
| DISPLAY: :99 | |
| run: | | |
| # Start virtual display for headless browser testing | |
| Xvfb :99 -screen 0 1024x768x24 & | |
| python python_components/accessibility_scan/main.py |