|
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 |
12 | 3 |
|
13 |
| -jobs: |
| 4 | +on: [push, pull_request, workflow_dispatch] |
14 | 5 |
|
15 |
| - # Test on all supported Python versions and platforms |
16 |
| - python_platform: |
| 6 | +jobs: |
17 | 7 |
|
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: |
22 | 10 |
|
23 | 11 | 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] |
31 | 14 |
|
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 }} |
38 | 16 |
|
39 | 17 | steps:
|
40 | 18 | - name: Check out code.
|
41 | 19 | uses: actions/checkout@v3
|
42 | 20 |
|
43 |
| - - name: Set up Python ${{ matrix.python }}. |
| 21 | + - name: Set up Python. |
44 | 22 | uses: actions/setup-python@v4
|
45 | 23 | with:
|
46 |
| - python-version: ${{ matrix.python }} |
| 24 | + python-version: '3.10' |
47 | 25 |
|
48 |
| - - name: Install package. |
| 26 | + - name: Install project. |
49 | 27 | run: pip install .[dev]
|
50 | 28 |
|
51 | 29 | - name: Run tests.
|
52 | 30 | run: pytest
|
53 | 31 |
|
54 |
| - # Test against Flake8 main |
55 |
| - flake8_main: |
56 | 32 |
|
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: |
60 | 35 |
|
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 |
63 | 41 |
|
64 | 42 | steps:
|
65 | 43 | - name: Check out code.
|
66 | 44 | uses: actions/checkout@v3
|
67 | 45 |
|
68 |
| - - name: Set up latest stable Python. |
| 46 | + - name: Set up Python ${{ matrix.python }}. |
69 | 47 | uses: actions/setup-python@v4
|
70 | 48 | 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 }} |
75 | 50 |
|
76 | 51 | - name: Install package.
|
77 | 52 | run: pip install .[dev]
|
|
0 commit comments