update plan #999
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: Django CI | |
| on: [push] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| build-amd64: | |
| runs-on: ubuntu-latest | |
| services: | |
| # Label used to access the service container | |
| postgres: | |
| # Docker Hub postgres image | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: tally | |
| ports: | |
| - 5432:5432 | |
| # Set health checks to wait until postgres has started | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| # Connect Postgres service with custom container image | |
| # https://github.community/t/connect-postgres-service-with-custom-container-image/189994 | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Memcached | |
| run: sudo apt-get update && sudo apt-get install -y memcached | |
| - name: Start Memcached | |
| run: sudo service memcached start | |
| - name: Install Redis | |
| run: sudo apt-get install -y redis-server | |
| - name: Start Redis | |
| run: sudo service redis-server start | |
| - name: Install gettext | |
| run: sudo apt-get install -y gettext | |
| - name: Install reportlab system dependencies | |
| run: sudo apt-get install -y libfreetype6-dev libjpeg-dev zlib1g-dev libfribidi-dev libharfbuzz-dev | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - run: uv python install | |
| - run: uv sync --locked | |
| - name: Run pre-commit | |
| uses: pre-commit/action@v3.0.1 | |
| - name: Generate Report | |
| run: | | |
| uv run pytest tally_ho --doctest-modules --junitxml=coverage.xml --cov=tally_ho --cov-report=xml --cov-report=html | |
| uv run python manage.py compilemessages -l ar | |
| uv run coverage xml | |
| ls -al | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload Coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| odk-central-sync: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: odk-central-sync | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - run: uv python install 3.13 | |
| - run: uv sync --locked | |
| - run: uv run pytest tests/ -v |