Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #79
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
# Pytest, pylint, codecov and publish. That's is folks | |
name: Build and publish | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
run-tests-and-coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, 3.10.0] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prepare environment | |
run: | | |
pip install poetry | |
poetry install | |
- name: Run linting | |
run: | | |
poetry run pylint --fail-under 10.0 **/*.py | |
poetry run mypy . | |
- name: Build package and check installation process is ok | |
run: | | |
poetry build | |
- name: Run tests | |
run: | | |
poetry run pytest -n2 ./ --cov=./ --cov-report=xml | |
- name: Upload code coverage to be accessed in next job | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |
path: ./coverage.xml | |
# TIP FOR FUTURE: canonical layout! checkout, unpack is strictly necessary in steps section!111 | |
upload-codecov: | |
runs-on: ubuntu-latest | |
needs: run-tests-and-coverage | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/[email protected] | |
with: | |
name: coverage | |
- uses: codecov/codecov-action@v2 | |
name: Upload coverage to Codecov | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
publish-pypi: | |
needs: upload-codecov | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Publish package | |
continue-on-error: true | |
run: | | |
pip install poetry | |
poetry publish --build -u ${{ secrets.FLIT_USERNAME }} -p ${{ secrets.FLIT_PASSWORD }} |