Skip to content

Merge pull request #465 from onaio/442-improve-intaken-form-visibility #572

Merge pull request #465 from onaio/442-improve-intaken-form-visibility

Merge pull request #465 from onaio/442-improve-intaken-form-visibility #572

Workflow file for this run

name: Django CI
on: [push]
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@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Cache Dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/dev.pip') }}
path: ./venv
- 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 uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to the PATH
- run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Generate Report
run: |
uv venv
source .venv/bin/activate
uv pip install -r requirements/dev.pip
python -m ruff check . --exit-non-zero-on-fix
python -m pytest tally_ho --doctest-modules --junitxml=coverage.xml --cov=tally_ho --cov-report=xml --cov-report=html
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