Skip to content

Update tox from 3.25.1 to 4.23.2 #1144

Update tox from 3.25.1 to 4.23.2

Update tox from 3.25.1 to 4.23.2 #1144

Workflow file for this run

name: "CI/CD"
on:
- push
- pull_request
env:
DEFAULT_PYTHON: "3.9"
jobs:
safety:
runs-on: ubuntu-latest
env:
TOX_JOB: safety
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: install ${{ env.TOX_JOB }} job runner
run: python -m pip install -r packaging/requirements-tox.txt
- name: run ${{ env.TOX_JOB }} job
run: tox -e $TOX_JOB
lint:
needs: [safety]
runs-on: ubuntu-latest
env:
TOX_JOB: lint
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: install ${{ env.TOX_JOB }} job runner
run: python -m pip install -r packaging/requirements-tox.txt
- name: run ${{ env.TOX_JOB }} job
run: tox -e $TOX_JOB
typecheck:
needs: [safety]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
env:
TOX_JOB: typecheck
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install ${{ env.TOX_JOB }} job runner
run: python -m pip install -r packaging/requirements-tox.txt
- name: run ${{ env.TOX_JOB }} job
run: tox
test:
needs: [safety]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
env:
TOX_JOB: test
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install ${{ env.TOX_JOB }} job runner
run: python -m pip install -r packaging/requirements-tox.txt
- name: run ${{ env.TOX_JOB }} job
run: tox
- name: upload coverage report artifact
uses: actions/upload-artifact@v2
with:
name: coverage-${{ matrix.os }}-python${{ matrix.python-version }}
path: coverage.xml
coverage-report:
needs: [test]
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
steps:
- name: checkout
uses: actions/checkout@v2
- name: download coverage report artifact
uses: actions/download-artifact@v2
with:
name: coverage-${{ matrix.os }}-python${{ matrix.python-version }}
- name: upload coverage report
uses: codecov/codecov-action@v2
with:
files: coverage.xml
env_vars: OS,PYTHON
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
build-docs:
needs: [safety]
runs-on: ubuntu-latest
env:
TOX_JOB: docs
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: install ${{ env.TOX_JOB }} job runner
run: python -m pip install -r packaging/requirements-tox.txt
- name: run ${{ env.TOX_JOB }} job
run: tox -e $TOX_JOB
- name: upload built docs artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: build/docs/html/
build-dist:
needs: [safety]
runs-on: ubuntu-latest
strategy:
matrix:
distribution:
- sdist
- wheel
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: install build tools
run: python -m pip install -r packaging/requirements-build.txt
- name: build ${{ matrix.distribution }}
run: python -m build --$DIST
env:
DIST: ${{ matrix.distribution }}
- name: upload ${{ matrix.distribution }} artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.distribution }}
path: dist/
publish-docs:
if: ${{ github.event_name == 'push' }}
needs:
- build-docs
- lint
- typecheck
- test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: download built docs artifact
uses: actions/download-artifact@v2
with:
name: docs
path: build/docs/html/
- name: deploy to github-pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: build/docs/html
publish-dist:
if: ${{ github.event_name == 'push' }}
needs:
- build-dist
- lint
- typecheck
- test
runs-on: ubuntu-latest
steps:
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: download sdist artifact
uses: actions/download-artifact@v2
with:
name: sdist
path: dist/
- name: download wheel artifact
uses: actions/download-artifact@v2
with:
name: wheel
path: dist/
- name: publish built artifacts to test.pypi.org
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: publish built artifacts to pypi.org
if: ${{ startsWith(github.ref, 'refs/tag') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}