Skip to content

Merge pull request #440 from onaio/recon_form_translation_updates #530

Merge pull request #440 from onaio/recon_form_translation_updates

Merge pull request #440 from onaio/recon_form_translation_updates #530

Workflow file for this run

name: Django CI
on: [push]
jobs:
container-job:
runs-on: ubuntu-20.04
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.0
uses: actions/setup-python@v2
with:
python-version: 3.9.0
- name: Cache Dependencies
uses: actions/cache@v2
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: Generate Report
run: |
python3 -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements/dev.pip
ruff check . --exit-non-zero-on-fix
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