Change/dataset/tag #78
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: Tests | |
on: | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'docker/**' | |
- 'docker-compose.yaml' | |
- 'pyproject.toml' | |
- '.github/workflows/tests.yml' | |
permissions: | |
contents: write | |
jobs: | |
compare-php: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
# A naive `docker compose up` would first build the `python-api` container and then | |
# start all services, which kickstarts Elastic Search and building indices. | |
# But since those two steps are independent, we can parallelize them to save time. | |
- run: | | |
docker compose build python-api | |
docker compose up -d --wait python-api php-api | |
- run: docker container ls && docker image ls | |
- run: docker exec python-api python -m pip freeze | |
- run: docker exec python-api coverage run -m pytest -xv -m "php_api" | |
- run: docker exec python-api coverage xml | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- run: docker compose up -d --wait database python-api | |
- run: docker container ls && docker image ls | |
- run: docker exec python-api python -m pip freeze | |
- run: docker exec python-api coverage run -m pytest -xv -m "not php_api" | |
- run: docker exec python-api coverage xml | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |