Skip to content

Commit f215ae5

Browse files
authored
Merge pull request #3616 from Flamefire/improve_gha
Refactor the CI configuration to use inclusion instead of exclusion
2 parents 6a5fca3 + 8999ed1 commit f215ae5

File tree

1 file changed

+52
-43
lines changed

1 file changed

+52
-43
lines changed

.github/workflows/unit_tests.yml

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,70 @@
22
name: EasyBuild framework unit tests
33
on: [push, pull_request]
44
jobs:
5+
setup:
6+
runs-on: ubuntu-latest
7+
outputs:
8+
lmod7: Lmod-7.8.22
9+
lmod8: Lmod-8.4.27
10+
modulesTcl: modules-tcl-1.147
11+
modules3: modules-3.2.10
12+
modules4: modules-4.1.4
13+
steps:
14+
- run: "true"
515
build:
16+
needs: setup
617
runs-on: ubuntu-18.04
718
strategy:
819
matrix:
9-
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
10-
modules_tool: [Lmod-7.8.22, Lmod-8.2.9, modules-tcl-1.147, modules-3.2.10, modules-4.1.4]
20+
python: [2.7, 3.6]
21+
modules_tool:
22+
# use variables defined by 'setup' job above, see also
23+
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
24+
- ${{needs.setup.outputs.lmod7}}
25+
- ${{needs.setup.outputs.lmod8}}
26+
- ${{needs.setup.outputs.modulesTcl}}
27+
- ${{needs.setup.outputs.modules3}}
28+
- ${{needs.setup.outputs.modules4}}
1129
module_syntax: [Lua, Tcl]
1230
lc_all: [""]
13-
# exclude some configuration for non-Lmod modules tool:
14-
# - don't test with Lua module syntax (only supported in Lmod)
15-
# - exclude Python 3.x versions other than 3.6, to limit test configurations
31+
# don't test with Lua module syntax (only supported in Lmod)
1632
exclude:
17-
- modules_tool: modules-tcl-1.147
33+
- modules_tool: ${{needs.setup.outputs.modulesTcl}}
1834
module_syntax: Lua
19-
- modules_tool: modules-3.2.10
35+
- modules_tool: ${{needs.setup.outputs.modules3}}
2036
module_syntax: Lua
21-
- modules_tool: modules-4.1.4
37+
- modules_tool: ${{needs.setup.outputs.modules4}}
2238
module_syntax: Lua
23-
- modules_tool: modules-tcl-1.147
24-
python: 3.5
25-
- modules_tool: modules-tcl-1.147
26-
python: 3.7
27-
- modules_tool: modules-tcl-1.147
28-
python: 3.8
29-
- modules_tool: modules-tcl-1.147
30-
python: 3.9
31-
- modules_tool: modules-3.2.10
32-
python: 3.5
33-
- modules_tool: modules-3.2.10
34-
python: 3.7
35-
- modules_tool: modules-3.2.10
36-
python: 3.8
37-
- modules_tool: modules-3.2.10
38-
python: 3.9
39-
- modules_tool: modules-4.1.4
40-
python: 3.5
41-
- modules_tool: modules-4.1.4
42-
python: 3.7
43-
- modules_tool: modules-4.1.4
44-
python: 3.8
45-
- modules_tool: modules-4.1.4
46-
python: 3.9
47-
- modules_tool: Lmod-7.8.22
48-
python: 3.5
49-
- modules_tool: Lmod-7.8.22
50-
python: 3.7
51-
- modules_tool: Lmod-7.8.22
52-
python: 3.8
53-
- modules_tool: Lmod-7.8.22
54-
python: 3.9
55-
# There may be encoding errors in Python 3 which are hidden when an UTF-8 encoding is set
56-
# Hence run the tests (again) with LC_ALL=C and Python 3.6 (or any < 3.7)
5739
include:
40+
# Test different Python 3 versions with Lmod 8.x (with both Lua and Tcl module syntax)
41+
- python: 3.5
42+
modules_tool: ${{needs.setup.outputs.lmod8}}
43+
module_syntax: Lua
44+
- python: 3.5
45+
modules_tool: ${{needs.setup.outputs.lmod8}}
46+
module_syntax: Tcl
47+
- python: 3.7
48+
modules_tool: ${{needs.setup.outputs.lmod8}}
49+
module_syntax: Lua
50+
- python: 3.7
51+
modules_tool: ${{needs.setup.outputs.lmod8}}
52+
module_syntax: Tcl
53+
- python: 3.8
54+
modules_tool: ${{needs.setup.outputs.lmod8}}
55+
module_syntax: Lua
56+
- python: 3.8
57+
modules_tool: ${{needs.setup.outputs.lmod8}}
58+
module_syntax: Tcl
59+
- python: 3.9
60+
modules_tool: ${{needs.setup.outputs.lmod8}}
61+
module_syntax: Lua
62+
- python: 3.9
63+
modules_tool: ${{needs.setup.outputs.lmod8}}
64+
module_syntax: Tcl
65+
# There may be encoding errors in Python 3 which are hidden when an UTF-8 encoding is set
66+
# Hence run the tests (again) with LC_ALL=C and Python 3.6 (or any < 3.7)
5867
- python: 3.6
59-
modules_tool: Lmod-8.2.9
68+
modules_tool: ${{needs.setup.outputs.lmod8}}
6069
module_syntax: Lua
6170
lc_all: C
6271
fail-fast: false

0 commit comments

Comments
 (0)