Exercise context #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: Smoke Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
python-test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.12' | |
opendp-version: | |
- '==0.8.0' | |
- '' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache pip dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('python/setup.cfg') }} | |
restore-keys: ${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest coverage | |
- name: Install package | |
run: python -m pip install -e . | |
- name: (Re)install opendp | |
run: python -m pip install 'opendp${{ matrix.opendp-version || '[polars]' }}' | |
- name: Test | |
# OpenDP doesn't have pretty pretty reprs in older versions, | |
# so skip the doc test in that case. | |
run: coverage run -m pytest -v ${{ matrix.opendp-version && '-k "not README and not context"' || '' }} | |
- name: Check coverage | |
run: coverage report |