|
4 | 4 | pull_request:
|
5 | 5 |
|
6 | 6 | jobs:
|
7 |
| - mypy: |
| 7 | + run-tox-env: |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + toxenv: [mypy, twine-check] |
| 11 | + py: ["3.x"] |
| 12 | + include: |
| 13 | + - toxenv: py-mindeps |
| 14 | + py: "3.7" |
| 15 | + |
8 | 16 | runs-on: ubuntu-latest
|
| 17 | + name: "Run '${{ matrix.toxenv }}' on python ${{ matrix.py }}" |
9 | 18 | steps:
|
10 | 19 | - uses: actions/checkout@v3
|
11 |
| - - uses: actions/setup-python@v4 |
12 |
| - with: |
13 |
| - python-version: '3.x' |
14 | 20 |
|
15 | 21 | - name: get date for caching
|
16 |
| - id: get-week-number |
17 |
| - run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT |
| 22 | + run: /bin/date -u "+%U" > cachedate.txt |
18 | 23 | shell: bash
|
19 | 24 |
|
20 |
| - - name: cache pip packages |
21 |
| - uses: actions/cache@v3 |
| 25 | + - uses: actions/setup-python@v4 |
22 | 26 | with:
|
23 |
| - path: ~/.cache/pip |
24 |
| - key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} |
| 27 | + python-version: "${{ matrix.py }}" |
| 28 | + cache: "pip" |
| 29 | + cache-dependency-path: | |
| 30 | + .github/workflows/build.yaml |
| 31 | + setup.cfg |
| 32 | + tox.ini |
| 33 | + cachedate.txt |
25 | 34 |
|
26 | 35 | - run: python -m pip install tox
|
27 | 36 |
|
28 |
| - - run: python -m tox run -e mypy |
| 37 | + - run: python -m tox run -e "${{ matrix.toxenv }}" |
29 | 38 |
|
30 |
| - test: |
| 39 | + ci-test-matrix: |
31 | 40 | strategy:
|
32 | 41 | matrix:
|
33 | 42 | os: [ubuntu-latest, windows-latest, macos-latest]
|
34 | 43 | py: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
35 |
| - name: "Run Tests on ${{ matrix.os }}, py${{ matrix.py }}" |
| 44 | + name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}" |
36 | 45 | runs-on: ${{ matrix.os }}
|
37 | 46 | steps:
|
38 | 47 | - uses: actions/checkout@v3
|
39 |
| - - uses: actions/setup-python@v4 |
40 |
| - with: |
41 |
| - python-version: ${{ matrix.py }} |
42 | 48 |
|
43 | 49 | - name: get date for caching
|
44 |
| - id: get-week-number |
45 |
| - run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT |
| 50 | + run: /bin/date -u "+%U" > cachedate.txt |
46 | 51 | shell: bash
|
47 | 52 |
|
48 |
| - - name: cache pip packages |
49 |
| - uses: actions/cache@v3 |
| 53 | + - uses: actions/setup-python@v4 |
| 54 | + id: setup-python |
50 | 55 | with:
|
51 |
| - path: ~/.cache/pip |
52 |
| - key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} |
| 56 | + python-version: ${{ matrix.py }} |
| 57 | + cache: "pip" |
| 58 | + cache-dependency-path: | |
| 59 | + .github/workflows/build.yaml |
| 60 | + setup.cfg |
| 61 | + tox.ini |
| 62 | + cachedate.txt |
53 | 63 |
|
54 | 64 | - run: python -m pip install tox
|
55 | 65 |
|
56 | 66 | - name: cache tox virtualenvs
|
57 | 67 | uses: actions/cache@v3
|
58 | 68 | with:
|
59 | 69 | path: .tox
|
60 |
| - key: tox-os-${{ runner.os }}-py${{ matrix.py }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}-hash-${{ hashFiles('tox.ini', 'setup.cfg') }} |
| 70 | + key: > |
| 71 | + tox |
| 72 | + os=${{ runner.os }} |
| 73 | + python=${{ steps.setup-python.outputs.python-version }} |
| 74 | + hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'tox.ini', 'cachedate.txt') }} |
61 | 75 |
|
62 | 76 | - name: test
|
63 | 77 | run: |
|
64 | 78 | python -m tox run-parallel -m ci
|
65 | 79 | python -m tox run -e cov
|
66 |
| - - name: twine-check |
67 |
| - run: python -m tox run -e twine-check |
68 | 80 |
|
69 | 81 | self-check:
|
70 | 82 | name: "Self-Check"
|
71 | 83 | runs-on: ubuntu-latest
|
72 | 84 | steps:
|
73 | 85 | - uses: actions/checkout@v3
|
74 | 86 |
|
75 |
| - - uses: actions/setup-python@v4 |
76 |
| - with: |
77 |
| - python-version: '3.x' |
78 |
| - |
79 | 87 | - name: get date for caching
|
80 |
| - id: get-week-number |
81 |
| - run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT |
| 88 | + run: /bin/date -u "+%U" > cachedate.txt |
82 | 89 | shell: bash
|
83 | 90 |
|
84 |
| - - name: cache pip packages |
85 |
| - uses: actions/cache@v3 |
| 91 | + - uses: actions/setup-python@v4 |
86 | 92 | with:
|
87 |
| - path: ~/.cache/pip |
88 |
| - key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }} |
| 93 | + python-version: "3.x" |
| 94 | + cache: "pip" |
| 95 | + cache-dependency-path: | |
| 96 | + .github/workflows/build.yaml |
| 97 | + setup.cfg |
| 98 | + tox.ini |
| 99 | + cachedate.txt |
89 | 100 |
|
90 | 101 | - name: install from source
|
91 |
| - run: | |
92 |
| - python -m pip install -U pip setuptools |
93 |
| - python -m pip install . |
| 102 | + run: python -m pip install . |
94 | 103 |
|
95 | 104 | - name: run on own workflows via HTTPS schema
|
96 |
| - run: check-jsonschema --schemafile "https://json.schemastore.org/github-workflow" .github/workflows/*.yaml |
| 105 | + run: check-jsonschema --schemafile "https://json.schemastore.org/github-workflow" .github/workflows/*.yaml |
97 | 106 |
|
98 | 107 | - name: run on own workflows via vendored schema
|
99 |
| - run: check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yaml |
| 108 | + run: check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yaml |
0 commit comments