Run Tests #48
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: | |
branches: [master, main] | |
pull_request: | |
branches: [master, main] | |
release: | |
types: [released] | |
workflow_run: | |
workflows: [ "MyPy" ] | |
branches: [ master, main ] | |
types: | |
- completed | |
jobs: | |
tests: | |
name: Tests | |
environment: Deployment | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
django-version: ["3.2.0", "4.1.3"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Run tests | |
run: | | |
echo '${{ secrets.GOOGLE_CLIENT_KEY }}' > key.json | |
poetry install --with dev | |
poetry run pip install "Django~=${{ matrix.django-version }}" | |
make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |