Skip to content

Improve a11y - Part 1 #3338

Improve a11y - Part 1

Improve a11y - Part 1 #3338

Workflow file for this run

name: Django CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-24.04
services:
postgres:
image: postgis/postgis:16-3.5
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 Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup Postgres
env:
PGPASSWORD: postgres
PGHOSTADDR: 127.0.0.1
run: |
psql -c 'create database django;' -U postgres
psql -c 'create database django_test;' -U postgres
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache pip packages
uses: actions/cache@v4
env:
cache-name: cache-pip-packages
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
env:
UV_PROJECT_ENVIRONMENT: "/home/runner/.local"
run: |
sudo apt update
sudo apt install -y gdal-bin
sudo apt install libsqlite3-mod-spatialite
npm install
pip install uv
uv sync --all-groups
uv add coveralls
- name: Run Tests
env:
PGPASSWORD: postgres
PGHOSTADDR: 127.0.0.1
run: |
DJANGO_SETTINGS_MODULE='tests.project.travis' py.test --cov
python manage.py makemigrations --dry-run --check --noinput
isort --diff -c adhocracy4 tests
flake8 adhocracy4 tests --exclude migrations,settings
npm run lint
- name: Run Frontend Tests
run: |
npm test
- name: Check Coverage File
run: |
echo "Checking if .coverage file exists..."
if [ -f .coverage ]; then
echo "✓ .coverage file exists"
echo "File size: $(du -h .coverage | cut -f1)"
echo "File type: $(file .coverage)"
echo "First 100 bytes:"
head -c 100 .coverage | hexdump -C
echo ""
echo "Testing coverage data..."
coverage report --skip-covered --skip-empty || echo "Coverage report failed"
else
echo "✗ .coverage file NOT found!"
echo "Current directory: $(pwd)"
echo "Looking for coverage files..."
find . -name ".coverage*" -type f 2>/dev/null || echo "No coverage files found"
exit 1
fi
- name: Coveralls Python
uses: coverallsapp/github-action@v2
with:
flag-name: python
parallel: true
file: .coverage
- name: Coveralls JS
uses: coverallsapp/github-action@v2
with:
flag-name: js
parallel: true
file: coverage/lcov.info
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "python,js"