Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

CI

CI #462

Workflow file for this run

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events.
push: {}
pull_request: {}
release:
types: [ published ]
# Run the pipeline daily so that we get continuous dogfooding and coverage of the latest Python
# and PyTest patch versions.
schedule:
# Run at 6pm UTC/10am Pacific
- cron: 0 18 * * *
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: { }
defaults:
run:
shell: bash -eo pipefail {0}
jobs:
check:
name: Typecheck, lint, and check code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
id: install
run: |
python -m pip install --upgrade pip
pip install tox==4.0.1
- name: Typecheck
run: tox -e mypy
- name: Lint
if: ${{ always() && steps.install.outcome == 'success' }}
run: tox -e flake8
- name: Check code style
if: ${{ always() && steps.install.outcome == 'success' }}
run: tox -e pycodestyle
- name: Build PyPI package
if: ${{ always() && steps.install.outcome == 'success' }}
run: |
pip install build==0.9.0 twine==4.0.2
python -m build
pytest_integration_tests:
name: "PyTest Integration Tests: py${{ matrix.python }}-${{ matrix.tox_env }}-${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs:
# Don't incur the cost of the test matrix if the basic build fails.
- check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
tox_env:
- pytest62
- pytest62-xdist
- pytest70
- pytest70-xdist
- pytest71
- pytest71-xdist
- pytest72
- pytest72-xdist
- pytest73
- pytest73-xdist
- pytest74
- pytest74-xdist
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox==4.0.1
- name: Test
run: |
UNFLAKABLE_API_KEY=${{ secrets.UNFLAKABLE_API_KEY }} \
tox -e ${{ matrix.tox_env }} \
--override testenv.pass_env=UNFLAKABLE_API_KEY \
--override testenv.basepython=python${{ matrix.python }} \
-- \
--enable-unflakable \
--test-suite-id 2AT4xgduQdwkVKSaO0qJ2Dqm2JY \
-s \
-v
publish:
name: Publish to PyPI
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs:
- check
- pytest_integration_tests
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build==0.9.0 twine==4.0.2
- name: Build package
run: |
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@717ba43cfbb0387f6ce311b169a825772f54d295
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}