Skip to content

Commit 2c0f9de

Browse files
committed
Introduce EasyBuild test in GitHub actions
Add test to check Lmod changes against EasyBuild framework non-regression test suite. Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent ad00a77 commit 2c0f9de

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/easybuild.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: run EasyBuild framework tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
framework:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
module_syntax: [Lua, Tcl]
10+
runs-on: ubuntu-24.04
11+
env:
12+
EASYBUILD_MODULES_TOOL: Lmod
13+
EASYBUILD_MODULE_SYNTAX: ${{ matrix.module_syntax }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Install system packages
19+
run: |
20+
sudo apt-get -y update
21+
# package required to build and install Lmod
22+
sudo apt-get install -y gcc tcl tcl-dev lua5.3 liblua5.3-dev lua-filesystem lua-json lua-posix lua-term
23+
# EasyBuild framework test requirement
24+
sudo apt-get install -y python3 python3-pycodestyle python3-pygraphviz python3-autopep8
25+
- name: Build and Install Lmod
26+
run: |
27+
./configure
28+
sudo make install
29+
- name: Fetch EasyBuild framework
30+
run: |
31+
# need to setup repository in HOME for test_run_shell_cmd_fail to succeed
32+
cd $HOME
33+
git clone https://github.com/easybuilders/easybuild-framework.git
34+
cd easybuild-framework
35+
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
36+
git switch --detach $latest_tag
37+
- name: Test EasyBuild framework suite with Lmod
38+
run: |
39+
cd ${HOME}/easybuild-framework
40+
source /usr/local/lmod/lmod/init/bash
41+
export TEST_EASYBUILD_MODULES_TOOL=${EASYBUILD_MODULES_TOOL}
42+
export TEST_EASYBUILD_MODULE_SYNTAX=${EASYBUILD_MODULE_SYNTAX}
43+
export PYTHONPATH=$(pwd):$PYTHONPATH
44+
export PATH=$(pwd):$PATH
45+
# fake this is a pull request build to skip test_push_branch_to_github
46+
export GITHUB_EVENT_NAME=pull_request
47+
# record output in file to check test suite result
48+
python -m test.framework.suite 2>&1 | tee test_framework_suite.log
49+
tail -n 1 test_framework_suite.log | grep --quiet '^OK$'
50+
- uses: actions/upload-artifact@v4
51+
if: failure()
52+
with:
53+
name: easybuild-${{ matrix.module_syntax }}-tests-logs-${{ github.job }}
54+
path: /tmp/eb-*/eb-*/easybuild-tests-*.log
55+
retention-days: 5

0 commit comments

Comments
 (0)