|
2 | 2 |
|
3 | 3 | name: on-commit |
4 | 4 |
|
5 | | -on: pull_request |
| 5 | +on: [pull_request, workflow_dispatch] |
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | test: |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 |
|
11 | 11 | strategy: |
12 | 12 | matrix: |
13 | | - python-version: ['3.6', '3.9', '3.10', 'pypy-3.7'] |
| 13 | + python-version: ['3.6', '3.8', '3.10', '3.11-dev', 'pypy3.9'] |
14 | 14 |
|
15 | 15 | steps: |
16 | | - - name: Check out the code |
17 | | - uses: actions/checkout@v2 |
| 16 | + - uses: actions/checkout@v3 |
18 | 17 | - name: Set up Python ${{ matrix.python-version }} |
19 | | - uses: actions/setup-python@v2 |
| 18 | + uses: actions/setup-python@v4 |
20 | 19 | with: |
21 | 20 | python-version: ${{ matrix.python-version }} |
22 | | - - name: Test with unittest |
23 | | - run: | |
24 | | - python -m unittest |
| 21 | + cache: 'pip' |
| 22 | + cache-dependency-path: 'requirements/test.txt' |
| 23 | + - name: Install dependencies |
| 24 | + run: python -m pip install -r requirements/test.txt |
| 25 | + - name: Test with pytest |
| 26 | + run: python -m pytest |
25 | 27 |
|
26 | 28 | style: |
27 | 29 | runs-on: ubuntu-latest |
28 | 30 |
|
29 | | - strategy: |
30 | | - matrix: |
31 | | - python-version: ['3.10'] |
32 | | - |
33 | 31 | steps: |
34 | | - - name: Check out the code |
35 | | - uses: actions/checkout@v2 |
36 | | - - name: Set up Python ${{ matrix.python-version }} |
37 | | - uses: actions/setup-python@v2 |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + - name: Set up Python 3.10 |
| 34 | + uses: actions/setup-python@v4 |
38 | 35 | with: |
39 | | - python-version: ${{ matrix.python-version }} |
| 36 | + python-version: '3.10' |
| 37 | + cache: 'pip' |
| 38 | + cache-dependency-path: 'requirements/style.txt' |
40 | 39 | - name: Install dependencies |
41 | | - run: | |
42 | | - python -m pip install --upgrade pip setuptools wheel |
43 | | - python -m pip install black flake8 isort mypy |
| 40 | + run: python -m pip install -r requirements/style.txt |
44 | 41 | - name: Run style checks |
45 | 42 | run: | |
46 | 43 | python -m flake8 . |
47 | | - python -m isort --check . |
48 | | - python -m black --check . |
| 44 | + python -m isort --check --diff . |
| 45 | + python -m black --check --diff . |
49 | 46 | python -m mypy --strict . |
0 commit comments