This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
[pre-commit.ci] pre-commit autoupdate #485
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: continuous-integration | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10'] | |
poetry-version: [1.1.13] | |
steps: | |
#---------------------------------------------- | |
# cancel any pending actions | |
#---------------------------------------------- | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.8.0 | |
with: | |
access_token: ${{ github.token }} | |
if: ${{github.ref != 'refs/head/master'}} | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# install & configure poetry | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: ${{ steps.cached-poetry-dependencies.outputs.cache-hit != 'true' }} | |
run: | | |
poetry env use ${{ matrix.python-version }} | |
poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if not already done | |
#---------------------------------------------- | |
- name: Install library | |
run: | | |
poetry env use ${{ matrix.python-version }} | |
poetry install --no-interaction | |
#---------------------------------------------- | |
# run test suite with coverage | |
#---------------------------------------------- | |
- name: Test with coverage | |
run: | | |
poetry run pytest --cov=pgmax --cov-report=xml --cov-report=term-missing:skip-covered | |
#---------------------------------------------- | |
# upload coverage report to codecov | |
#---------------------------------------------- | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
verbose: true # optional (default = false) | |
#---------------------------------------------- | |
# test docs build only on PR | |
#---------------------------------------------- | |
- name: Test docs build | |
run: | | |
cd docs | |
poetry run make html SPHINXOPTS="-W" |