Skip to content

Commit 12d17a4

Browse files
committed
also test create_lmodsitepackage.py in CI
1 parent f25bfe0 commit 12d17a4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/tests_scripts.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- build_container.sh
77
- create_directory_tarballs.sh
8+
- create_lmodsitepackage.py
89
- EESSI-install-software.sh
910
- install_software_layer.sh
1011
- load_easybuild_module.sh
@@ -16,6 +17,7 @@ on:
1617
paths:
1718
- build_container.sh
1819
- create_directory_tarballs.sh
20+
- create_lmodsitepackage.py
1921
- EESSI-install-software.sh
2022
- install_software_layer.sh
2123
- load_easybuild_module.sh
@@ -94,3 +96,22 @@ jobs:
9496
./eessi_container.sh --mode run --verbose /software-layer/create_directory_tarballs.sh 2023.06
9597
# check if tarballs have been produced
9698
ls -l *.tar.gz
99+
100+
- name: test create_lmodsitepackage.py script
101+
run: |
102+
# bind current directory into container as /software-layer
103+
export SINGULARITY_BIND="${PWD}:/software-layer"
104+
105+
python3 create_lmodsitepackage.py .
106+
export LMOD_PACKAGE_PATH="$PWD/.lmod"
107+
# run some commands to make sure that generated Lmod SitePackage file works
108+
test_script="${PWD}/test_lmod_sitepackage.sh"
109+
echo '#!/bin/bash' > ${test_script}
110+
echo 'ml --config' >> ${test_script}
111+
112+
chmod u+x ${test_script}
113+
114+
./eessi_container.sh --mode run --verbose /software-layer/run_in_compat_layer_env.sh /software-layer/test_lmod_sitepackage.sh 2>&1 | tee ${out}
115+
for pattern in "^Site Pkg location.*$PWD/.lmod/SitePackage.lua" "LMOD_SITEPACKAGE_LOCATION.*${PWD}/.lmod/SitePackage.lua"; do
116+
grep "${pattern}" ${out} || (echo "Pattern '${pattern}' not found in output!" && exit 1)
117+
done

0 commit comments

Comments
 (0)