Skip to content

Commit

Permalink
Separate regularly scheduled test from commit-related tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-hen committed Dec 22, 2022
1 parent ec6d855 commit 3b56b1c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 54 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/report_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Report coverage
# Report code coverage to Codecov.
name: Report coverage

on: [push, workflow_dispatch]

jobs:

# Report code coverage to Codecov.
coverage:

runs-on: ubuntu-latest

strategy:
matrix:
python: ["3.10", "3.11"]
python: ['3.10', '3.11']

steps:
- name: Check out code.
Expand All @@ -22,13 +22,11 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install package.
run: |
python -m pip install --upgrade pip
pip install --editable .[dev]
- name: Install project.
run: pip install --editable .[dev]

- name: Measure code coverage.
run: pytest --cov --cov-report xml
run: pytest --cov --cov-report xml

- name: Upload coverage report.
uses: codecov/codecov-action@v3
Expand Down
67 changes: 21 additions & 46 deletions .github/workflows/test_commit.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,52 @@
name: Test commit

on:
push:
pull_request:
workflow_dispatch:
schedule:
# Every day at 1 AM
- cron: '0 1 * * *'
# Every wednesday at 1 AM
- cron: '0 1 * * 3'
# Test commit on all supported platforms and Python versions.
name: Test commit

jobs:
on: [push, pull_request, workflow_dispatch]

# Test on all supported Python versions and platforms
python_platform:
jobs:

name: ${{ matrix.python }} (${{ matrix.os }})
if: github.event_name != 'schedule' || github.event.schedule == '0 1 * * 3'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.optional || false }}
# Test on all three platforms.
platform:

strategy:
matrix:
os: ['ubuntu-latest']
python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
include:

- os: windows-latest
python: '3.x'
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

- os: macos-latest
python: '3.x'

- python: '3.12-dev'
os: ubuntu-latest
optional: true
runs-on: ${{ matrix.os }}

steps:
- name: Check out code.
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}.
- name: Set up Python.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: '3.10'

- name: Install package.
- name: Install project.
run: pip install .[dev]

- name: Run tests.
run: pytest

# Test against Flake8 main
flake8_main:

name: Flake8 main
if: github.event_name != 'schedule' || github.event.schedule == '0 1 * * *'
runs-on: ubuntu-latest
# Test on all supported Python versions.
Python:

# Uncomment to prevent failure from blocking
# continue-on-error: True
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']

runs-on: ubuntu-latest

steps:
- name: Check out code.
uses: actions/checkout@v3

- name: Set up latest stable Python.
- name: Set up Python ${{ matrix.python }}.
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install flake8 main
run: pip install git+https://github.com/PyCQA/flake8.git
python-version: ${{ matrix.python }}

- name: Install package.
run: pip install .[dev]
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test_scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Regular tests against the current Flake8 main branch.
name: Test nightly

on:
schedule:
# Every day at 1 a.m.
- cron: '0 1 * * *'

jobs:

flake8_main:

runs-on: ubuntu-latest

steps:
- name: Check out code.
uses: actions/checkout@v3

- name: Set up latest stable Python.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install current Flake8 main branch.
run: pip install git+https://github.com/PyCQA/flake8.git

- name: Install project.
run: pip install .[dev]

- name: Run tests.
run: pytest

0 comments on commit 3b56b1c

Please sign in to comment.