Merge pull request #269 from OCHA-DAP/feature/HDX-10326-add-start-end… #806
Workflow file for this run
This file contains 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: Run tests | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build the docker compose stack | |
run: | | |
cd docker | |
docker compose up -d | |
- name: Install requirements | |
run: | | |
cd docker | |
docker compose exec -T hapi sh -c "apk add git python3-dev" | |
docker compose exec -T hapi sh -c "pip install --upgrade -r requirements.txt" | |
docker compose exec -T hapi sh -c "pip install --upgrade -r dev-requirements.txt" | |
- name: Setup database | |
run: | | |
./initialize_test_db.sh | |
env: | |
DCOMPOSE: "docker compose" | |
- name: Test with pytest | |
run: | | |
cd docker | |
docker compose exec -T hapi sh -c "pytest --log-level=INFO --cov=. --cov-report term --cov-report xml:coverage.xml" | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 |