22name : EasyBuild framework unit tests
33on : [push, pull_request]
44jobs :
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]
12- # exclude some configuration for non-Lmod modules tool:
13- # - don't test with Lua module syntax (only supported in Lmod)
14- # - exclude Python 3.x versions other than 3.6, to limit test configurations
30+ lc_all : [""]
31+ # don't test with Lua module syntax (only supported in Lmod)
1532 exclude :
16- - modules_tool : modules-tcl-1.147
33+ - modules_tool : ${{needs.setup.outputs.modulesTcl}}
34+ module_syntax : Lua
35+ - modules_tool : ${{needs.setup.outputs.modules3}}
36+ module_syntax : Lua
37+ - modules_tool : ${{needs.setup.outputs.modules4}}
38+ module_syntax : Lua
39+ 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}}
1743 module_syntax : Lua
18- - modules_tool : modules-3.2.10
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}}
1949 module_syntax : Lua
20- - modules_tool : modules-4.1.4
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}}
2155 module_syntax : Lua
22- - modules_tool : modules-tcl-1.147
23- python : 3.5
24- - modules_tool : modules-tcl-1.147
25- python : 3.7
26- - modules_tool : modules-tcl-1.147
27- python : 3.8
28- - modules_tool : modules-tcl-1.147
29- python : 3.9
30- - modules_tool : modules-3.2.10
31- python : 3.5
32- - modules_tool : modules-3.2.10
33- python : 3.7
34- - modules_tool : modules-3.2.10
35- python : 3.8
36- - modules_tool : modules-3.2.10
37- python : 3.9
38- - modules_tool : modules-4.1.4
39- python : 3.5
40- - modules_tool : modules-4.1.4
41- python : 3.7
42- - modules_tool : modules-4.1.4
43- python : 3.8
44- - modules_tool : modules-4.1.4
45- python : 3.9
46- - modules_tool : Lmod-7.8.22
47- python : 3.5
48- - modules_tool : Lmod-7.8.22
49- python : 3.7
50- - modules_tool : Lmod-7.8.22
51- python : 3.8
52- - modules_tool : Lmod-7.8.22
53- python : 3.9
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)
67+ - python : 3.6
68+ modules_tool : ${{needs.setup.outputs.lmod8}}
69+ module_syntax : Lua
70+ lc_all : C
5471 fail-fast : false
5572 steps :
5673 - uses : actions/checkout@v2
6986 # for modules tool
7087 sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
7188 # fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
72- sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so
89+ # needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
90+ if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
91+ sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so
92+ fi
7393 # for GitPython, python-hglib
7494 sudo apt-get install git mercurial
7595 # dep for GC3Pie
@@ -89,12 +109,20 @@ jobs:
89109 # see https://github.com/<username>/easybuild-framework/settings/secrets
90110 GITHUB_TOKEN : ${{secrets.TEST_GITHUB_TOKEN}}
91111 run : |
92- if [ ! -z $GITHUB_TOKEN ]; then
93- if [ "x${{matrix.python}}" == 'x2.6' ];
112+ # don't install GitHub token when testing with Lmod 7.x or non-Lmod module tools,
113+ # to avoid hitting GitHub rate limit;
114+ # tests that require a GitHub token are skipped automatically when no GitHub token is available
115+ if [[ ! "${{matrix.modules_tool}}" =~ 'Lmod-7' ]] && [[ ! "${{matrix.modules_tool}}" =~ 'modules-' ]]; then
116+ if [ ! -z $GITHUB_TOKEN ]; then
117+ if [ "x${{matrix.python}}" == 'x2.6' ];
94118 then SET_KEYRING="keyring.set_keyring(keyring.backends.file.PlaintextKeyring())";
95119 else SET_KEYRING="import keyrings; keyring.set_keyring(keyrings.alt.file.PlaintextKeyring())";
96- fi;
97- python -c "import keyring; $SET_KEYRING; keyring.set_password('github_token', 'easybuild_test', '$GITHUB_TOKEN')";
120+ fi;
121+ python -c "import keyring; $SET_KEYRING; keyring.set_password('github_token', 'easybuild_test', '$GITHUB_TOKEN')";
122+ fi
123+ echo "GitHub token installed!"
124+ else
125+ echo "Installation of GitHub token skipped!"
98126 fi
99127
100128 - name : install modules tool
@@ -129,6 +157,7 @@ jobs:
129157 EB_VERBOSE : 1
130158 EASYBUILD_MODULE_SYNTAX : ${{matrix.module_syntax}}
131159 TEST_EASYBUILD_MODULE_SYNTAX : ${{matrix.module_syntax}}
160+ LC_ALL : ${{matrix.lc_all}}
132161 run : |
133162 # run tests *outside* of checked out easybuild-framework directory,
134163 # to ensure we're testing installed version (see previous step)
0 commit comments