19
19
generate_test_matrix :
20
20
runs-on : ubuntu-latest
21
21
outputs :
22
- extras : ${{ steps.set-matrix.outputs.extras }}
22
+ include : ${{ steps.set-matrix.outputs.include }}
23
23
steps :
24
24
- name : Checkout
25
25
uses : actions/checkout@v3
@@ -36,13 +36,17 @@ jobs:
36
36
import tomllib
37
37
import os
38
38
import json
39
+ from itertools import product
39
40
with open('pyproject.toml', 'rb') as f:
40
41
manifest = tomllib.load(f)
41
- yaml = [''] + list(manifest['tool']['poetry']['extras'])
42
+ extras = [''] + list(manifest['tool']['poetry']['extras'])
43
+ platforms = ['ubuntu-latest', 'macos-latest','windows-latest']
44
+ python = '3.7'
45
+ yaml = [ {'os': o,'python-version': p, 'extras': e} for o, p, e in product(platforms, [python], extras)]
42
46
out = json.dumps(yaml)
43
47
print(out)
44
48
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
45
- f.write('extras =' + out)
49
+ f.write('include =' + out)
46
50
47
51
test :
48
52
name : test ${{ matrix.extras && 'with' || '' }} ${{ matrix.extras }} on ${{ matrix.python-version }}, ${{ matrix.os }}
52
56
matrix :
53
57
os : [ubuntu-latest, macos-latest, windows-latest]
54
58
python-version : ["3.7", "3.8", "3.9", "3.10", "3.11"]
55
- extras : ${{ fromJson(needs.generate_test_matrix.outputs.extras) }}
59
+ extras : ["", "pre-commit"]
60
+ include : ${{ fromJson(needs.generate_test_matrix.outputs.include) }}
56
61
fail-fast : false
57
62
steps :
58
63
- name : Checkout
0 commit comments