make target param optional #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
# This workflow will build the package and validate it (e.g. inspect code formatting, run tests) against multiple Python versions and OSs. | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
code-checks: | |
name: code-checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python v3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Install Package Dependencies (required and dev) | |
run: | | |
poetry check | |
poetry install | |
- name: Inspect Code Security | |
run: | | |
poetry run bandit -r . -c "pyproject.toml" | |
- name: Inspect Code Formatting | |
run: | | |
poetry run black . --check | |
poetry run autoflake --check -r --remove-all-unused-imports --ignore-init-module-imports . | |
poetry run isort . --check | |
- name: Run Tests with Coverage | |
run: | | |
poetry run pytest --cov --cov-report=xml | |
- name: Upload Coverage Report to codecov.io | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
fail_ci_if_error: true | |
- name: Build | |
run: | | |
poetry build | |
build: | |
name: build | |
needs: code-checks | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.10', '3.11'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python v${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Install Package Dependencies (required and dev) | |
run: | | |
poetry check | |
poetry install | |
- name: Run Tests | |
run: | | |
poetry run pytest |