Conditionally import ZoneInfo; use GHA matrix strategy #29
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: CI - Pytest | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened, edited, synchronize] | |
env: | |
CATCHPY_DOTENV_PATH: docker_dotenv.env | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker images | |
run: | | |
PYTHON_VERSION=${{ matrix.python-version }} docker compose -f docker-compose-test.yml build | |
- name: Run Docker Compose containers | |
run: | | |
PYTHON_VERSION=${{ matrix.python-version }} docker compose -f docker-compose-test.yml up -d | |
- name: Run Pytest unit tests within Compose | |
run: | | |
docker compose -f docker-compose-test.yml exec web pytest | |
- name: Stop Docker Compose containers | |
if: always() | |
run: docker compose -f docker-compose.yml down |