test #103
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
# Basic testing taken from [[https://github.com/marketplace/actions/install-poetry-action#mtesting]] | |
name: test | |
on: [pull_request, workflow_dispatch] | |
jobs: | |
test: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ "ubuntu-latest", "macos-latest" ] | |
python-version: [ "3.7", "3.8", "3.9" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# install poethepoet | |
#---------------------------------------------- | |
- name: Install poethepoet | |
run: python -m pip install poethepoet | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.5.1 | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# dummy doc | |
#---------------------------------------------- | |
- name: Dummy doc | |
run: poe dummydoc | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# install plugins (for tests) | |
#---------------------------------------------- | |
- name: Install plugins | |
run: poetry run python -m pip install csv-reconcile-geo | |
#---------------------------------------------- | |
# add matrix specifics and run test suite | |
#---------------------------------------------- | |
- name: Run tests | |
run: | | |
poetry run pytest tests/ |