Merge pull request #8 from cchristiansen/master #98
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
# Based on the following resources: | |
# https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml | |
# https://www.marwandebbiche.com/posts/python-package-tooling/ | |
# https://github.com/marketplace/actions/install-poetry-action | |
name: Testing | |
on: # events that trigger this workflow | |
push: | |
branches: | |
- master | |
workflow_dispatch: # manual trigger | |
jobs: | |
test: | |
# Matrix testing allows us to test multiple Python versions | |
# We will also fail-fast - fail the job if it fails for any context | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["ubuntu-latest", "macos-latest"] | |
python-version: ["3.8", "3.9", "3.10"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Checkout the repo so the workflow can access it | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Install the specified version of poetry | |
- name: Get poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.2.0 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
# Load cached poetry env if it exists | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
# Set up Python, with a cache for poetry deps | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
# Install poetry env with test group | |
# poetry install --with= is 1.2.0 behaviour | |
- name: Install poetry env with test group | |
run: poetry install --with=test | |
# Run tests | |
- name: Run tests | |
env: | |
SUPABASE_BIDDING_DASHBOARD_URL: ${{ secrets.SUPABASE_BIDDING_DASHBOARD_URL }} | |
SUPABASE_BIDDING_DASHBOARD_KEY: ${{ secrets.SUPABASE_BIDDING_DASHBOARD_KEY }} | |
run: | | |
poetry run pytest -k "not query_postgres" |