Tutorial stuff #238
Workflow file for this run
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: fast tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- '8.*.x' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false # Don't let a failed MacOS run stop the Ubuntu runs | |
matrix: | |
os: ['ubuntu-latest'] | |
python-version: ['3.7', '3.8', '3.10', '3.11'] | |
include: | |
# mac os test | |
- os: 'macos-11' | |
python-version: '3.7' # oldest supported version | |
# non-utc timezone test | |
- os: 'ubuntu-latest' | |
python-version: '3.9' # not the oldest, not the most recent version | |
time-zone: 'XXX-09:35' | |
env: | |
TZ: ${{ matrix.time-zone }} | |
PYTEST_ADDOPTS: --cov --cov-append -n 5 --color=yes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Apt-Get Install | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y shellcheck sqlite3 | |
- name: Install | |
run: | | |
pip install -e ."[all]" | |
- name: Configure git # Needed by the odd test | |
uses: cylc/release-actions/configure-git@v1 | |
- name: Check changelog | |
if: startsWith(matrix.os, 'ubuntu') | |
run: towncrier build --draft | |
- name: Style | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
flake8 | |
etc/bin/shellchecker | |
# note: exclude python 3.10+ from mypy checks as these produce false | |
# positives in installed libraries for python 3.7 | |
- name: Typing | |
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python-version, 3.9) | |
run: mypy | |
- name: Doctests | |
timeout-minutes: 4 | |
run: | | |
pytest cylc/flow | |
- name: Unit Tests | |
timeout-minutes: 4 | |
run: | | |
pytest tests/unit | |
- name: Bandit | |
if: ${{ matrix.python-version == '3.7' }} | |
# https://github.com/PyCQA/bandit/issues/658 | |
run: | | |
bandit -r --ini .bandit cylc/flow | |
- name: Integration Tests | |
timeout-minutes: 6 | |
run: | | |
pytest tests/integration | |
- name: Upload failed tests artifact | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cylc-run (${{ matrix.os }} py-${{ matrix.python-version }}) | |
path: ~/cylc-run/ | |
- name: Coverage report | |
run: | | |
coverage xml | |
coverage report | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_${{ matrix.os }}_py-${{ matrix.python-version }} | |
path: coverage.xml | |
retention-days: 7 | |
- name: Linkcheck | |
if: startsWith(matrix.python-version, '3.10') | |
run: pytest -m linkcheck --dist=load tests/unit | |
codecov: | |
needs: test | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download coverage artifacts | |
uses: actions/download-artifact@v3 | |
- name: Codecov upload | |
uses: codecov/codecov-action@v3 | |
with: | |
name: ${{ github.workflow }} | |
flags: fast-tests | |
fail_ci_if_error: true | |
verbose: true | |
# Token not required for public repos, but avoids upload failure due | |
# to rate-limiting (but not for PRs opened from forks) | |
token: ${{ secrets.CODECOV_TOKEN }} |