@@ -3,62 +3,95 @@ name: Tox Workflow
3
3
' on ' :
4
4
workflow_call :
5
5
jobs :
6
- tox :
7
- runs-on : ubuntu-20.04
8
- strategy :
9
- fail-fast : false
10
- matrix :
11
- environment : [pep8,py3]
12
- python-minor-version : [6,8,10,12]
13
- is-not-python36 :
14
- - ${{
6
+
7
+ define-matrix :
8
+ runs-on : ubuntu-latest
9
+ outputs :
10
+ tox-matrix : ${{ steps.matrix.outputs.tox-matrix }}
11
+ steps :
12
+ - name : Define Tox matrix
13
+ id : matrix
14
+ env :
15
+ PY3_8 : ${{
16
+ (github.base_ref == 'stackhpc/yoga') ||
17
+ (github.ref == 'refs/heads/stackhpc/yoga') ||
18
+ (github.base_ref == 'stackhpc/zed') ||
19
+ (github.ref == 'refs/heads/stackhpc/zed') ||
20
+ (github.base_ref == 'stackhpc/2023.1') ||
21
+ (github.ref == 'refs/heads/stackhpc/2023.1') ||
22
+ (((github.base_ref == 'stackhpc/2024.1') ||
23
+ (github.ref == 'refs/heads/stackhpc/2024.1')) &&
24
+ (github.repository != 'stackhpc/kayobe'))
25
+ }}
26
+ PY3_10 : ${{
15
27
(github.base_ref == 'stackhpc/zed') ||
16
28
(github.ref == 'refs/heads/stackhpc/zed') ||
17
29
(github.base_ref == 'stackhpc/2023.1') ||
18
30
(github.ref == 'refs/heads/stackhpc/2023.1') ||
19
- (github.base_ref == 'stackhpc/2023.2') ||
20
- (github.ref == 'refs/heads/stackhpc/2023.2') ||
21
31
(github.base_ref == 'stackhpc/2024.1') ||
22
32
(github.ref == 'refs/heads/stackhpc/2024.1') ||
23
33
(github.base_ref == 'stackhpc/2025.1') ||
24
34
(github.ref == 'refs/heads/stackhpc/2025.1') ||
25
35
(github.base_ref == 'stackhpc/master') ||
26
36
(github.ref == 'refs/heads/stackhpc/master')
27
- }}
28
- is-not-python38 :
29
- - ${{
30
- ((github.repository == 'stackhpc/kayobe') &&
31
- ((github.base_ref == 'stackhpc/2024.1') ||
32
- (github.ref == 'refs/heads/stackhpc/2024.1'))) ||
37
+ }}
38
+ PY3_12 : ${{
33
39
(github.base_ref == 'stackhpc/2025.1') ||
34
40
(github.ref == 'refs/heads/stackhpc/2025.1') ||
35
41
(github.base_ref == 'stackhpc/master') ||
36
42
(github.ref == 'refs/heads/stackhpc/master')
37
- }}
38
- is-primarily-python312 :
39
- - ${{
43
+ }}
44
+ PEP8_8 : ${{
45
+ (github.base_ref == 'stackhpc/yoga') ||
46
+ (github.ref == 'refs/heads/stackhpc/yoga')
47
+ }}
48
+ PEP8_10 : ${{
49
+ (github.base_ref == 'stackhpc/zed') ||
50
+ (github.ref == 'refs/heads/stackhpc/zed') ||
51
+ (github.base_ref == 'stackhpc/2023.1') ||
52
+ (github.ref == 'refs/heads/stackhpc/2023.1') ||
53
+ (github.base_ref == 'stackhpc/2024.1') ||
54
+ (github.ref == 'refs/heads/stackhpc/2024.1')
55
+ }}
56
+ PEP8_12 : ${{
40
57
(github.base_ref == 'stackhpc/2025.1') ||
41
58
(github.ref == 'refs/heads/stackhpc/2025.1') ||
42
59
(github.base_ref == 'stackhpc/master') ||
43
60
(github.ref == 'refs/heads/stackhpc/master')
44
- }}
45
- exclude :
46
- - environment : pep8
47
- python-minor-version : 6
48
- - is-not-python36 : true
49
- python-minor-version : 6
50
- - is-not-python36 : true
51
- environment : pep8
52
- python-minor-version : 8
53
- - is-not-python36 : false
54
- python-minor-version : 10
55
- - is-not-python38 : true
56
- python-minor-version : 8
57
- - is-primarily-python312 : true
58
- environment : pep8
59
- python-minor-version : 10
60
- - is-primarily-python312 : false
61
- python-minor-version : 12
61
+ }}
62
+ run : |
63
+ # Create a matrix based on the environment and Python minor version
64
+ output="["
65
+ if [[ $PY3_8 == 'true' ]]; then
66
+ output+="{'environment': 'py3', 'python-minor-version': 8},"
67
+ fi
68
+ if [[ $PY3_10 == 'true' ]]; then
69
+ output+="{'environment': 'py3', 'python-minor-version': 10},"
70
+ fi
71
+ if [[ $PY3_12 == 'true' ]]; then
72
+ output+="{'environment': 'py3', 'python-minor-version': 12},"
73
+ fi
74
+ if [[ $PEP8_8 == 'true' ]]; then
75
+ output+="{'environment': 'pep8', 'python-minor-version': 8},"
76
+ fi
77
+ if [[ $PEP8_10 == 'true' ]]; then
78
+ output+="{'environment': 'pep8', 'python-minor-version': 10},"
79
+ fi
80
+ if [[ $PEP8_12 == 'true' ]]; then
81
+ output+="{'environment': 'pep8', 'python-minor-version': 12},"
82
+ fi
83
+ # remove trailing comma
84
+ output="${output%,}"
85
+ output+="]"
86
+ echo "tox-matrix=$output" >> $GITHUB_OUTPUT
87
+
88
+ tox :
89
+ runs-on : ubuntu-latest
90
+ needs : define-matrix
91
+ strategy :
92
+ fail-fast : false
93
+ matrix :
94
+ include : ${{ fromJSON(needs.define-matrix.outputs.tox-matrix) }}
62
95
63
96
name : Tox ${{ matrix.environment }} with Python 3.${{ matrix.python-minor-version }}
64
97
steps :
0 commit comments