Add deployment test to pytest; separate unit and deployment tests #386
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 Unit Test via Pytest | |
on: | |
push: | |
paths: | |
- '**/*.py' | |
- .github/workflows/run_test.yml | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
poetry-version: ["1.8.3"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Poetry Dependencies Caching Step 1, set up a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Poetry Dependencies Caching Step 2, define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies using Poetry | |
run: poetry install | |
- name: Run unit tests with pytest | |
run: | | |
poetry run python -m pytest tests/ -s --durations=5 -m "not deployment" | |
- name: Run deployment tests with pytest | |
run: | | |
poetry run python -m pytest tests/ -s --durations=5 -m deployment | |
# - name: Generate Coverage Report | |
# run: | | |
# coverage report -m |