Skip to content

Commit 3b56b1c

Browse files
committed
Separate regularly scheduled test from commit-related tests.
1 parent ec6d855 commit 3b56b1c

File tree

3 files changed

+58
-54
lines changed

3 files changed

+58
-54
lines changed

.github/workflows/report_coverage.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: Report coverage
1+
# Report code coverage to Codecov.
2+
name: Report coverage
23

34
on: [push, workflow_dispatch]
45

56
jobs:
67

7-
# Report code coverage to Codecov.
88
coverage:
99

1010
runs-on: ubuntu-latest
1111

1212
strategy:
1313
matrix:
14-
python: ["3.10", "3.11"]
14+
python: ['3.10', '3.11']
1515

1616
steps:
1717
- name: Check out code.
@@ -22,13 +22,11 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python }}
2424

25-
- name: Install package.
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install --editable .[dev]
25+
- name: Install project.
26+
run: pip install --editable .[dev]
2927

3028
- name: Measure code coverage.
31-
run: pytest --cov --cov-report xml
29+
run: pytest --cov --cov-report xml
3230

3331
- name: Upload coverage report.
3432
uses: codecov/codecov-action@v3

.github/workflows/test_commit.yml

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,52 @@
1-
name: Test commit
2-
3-
on:
4-
push:
5-
pull_request:
6-
workflow_dispatch:
7-
schedule:
8-
# Every day at 1 AM
9-
- cron: '0 1 * * *'
10-
# Every wednesday at 1 AM
11-
- cron: '0 1 * * 3'
1+
# Test commit on all supported platforms and Python versions.
2+
name: Test commit
123

13-
jobs:
4+
on: [push, pull_request, workflow_dispatch]
145

15-
# Test on all supported Python versions and platforms
16-
python_platform:
6+
jobs:
177

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

2311
strategy:
24-
matrix:
25-
os: ['ubuntu-latest']
26-
python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
27-
include:
28-
29-
- os: windows-latest
30-
python: '3.x'
12+
matrix:
13+
os: [windows-latest, ubuntu-latest, macos-latest]
3114

32-
- os: macos-latest
33-
python: '3.x'
34-
35-
- python: '3.12-dev'
36-
os: ubuntu-latest
37-
optional: true
15+
runs-on: ${{ matrix.os }}
3816

3917
steps:
4018
- name: Check out code.
4119
uses: actions/checkout@v3
4220

43-
- name: Set up Python ${{ matrix.python }}.
21+
- name: Set up Python.
4422
uses: actions/setup-python@v4
4523
with:
46-
python-version: ${{ matrix.python }}
24+
python-version: '3.10'
4725

48-
- name: Install package.
26+
- name: Install project.
4927
run: pip install .[dev]
5028

5129
- name: Run tests.
5230
run: pytest
5331

54-
# Test against Flake8 main
55-
flake8_main:
5632

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

61-
# Uncomment to prevent failure from blocking
62-
# continue-on-error: True
36+
strategy:
37+
matrix:
38+
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
39+
40+
runs-on: ubuntu-latest
6341

6442
steps:
6543
- name: Check out code.
6644
uses: actions/checkout@v3
6745

68-
- name: Set up latest stable Python.
46+
- name: Set up Python ${{ matrix.python }}.
6947
uses: actions/setup-python@v4
7048
with:
71-
python-version: "3.x"
72-
73-
- name: Install flake8 main
74-
run: pip install git+https://github.com/PyCQA/flake8.git
49+
python-version: ${{ matrix.python }}
7550

7651
- name: Install package.
7752
run: pip install .[dev]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Regular tests against the current Flake8 main branch.
2+
name: Test nightly
3+
4+
on:
5+
schedule:
6+
# Every day at 1 a.m.
7+
- cron: '0 1 * * *'
8+
9+
jobs:
10+
11+
flake8_main:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out code.
17+
uses: actions/checkout@v3
18+
19+
- name: Set up latest stable Python.
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install current Flake8 main branch.
25+
run: pip install git+https://github.com/PyCQA/flake8.git
26+
27+
- name: Install project.
28+
run: pip install .[dev]
29+
30+
- name: Run tests.
31+
run: pytest

0 commit comments

Comments
 (0)