1- name : Test Registry Module
1+ name : Test Modules
22
33on :
4- pull_request :
5- types : [labeled]
4+ pull_request : []
65
76jobs :
8- test-registry :
9- if : ${{ github.event.label.name == 'container-recipe' }}
7+ test :
108 runs-on : ubuntu-latest
9+ strategy :
10+ fail-fast : false
11+ matrix :
12+ module : ["lmod", "tcl"]
13+ container_tech : ["podman", "singularity"]
1114 steps :
15+
1216 - name : Install Dependencies
1317 run : |
1418 sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
1519
20+ - name : Install environment modules
21+ if : ${{ matrix.module == 'tcl' }}
22+ run : |
23+ curl -LJO https://github.com/cea-hpc/modules/releases/download/v4.7.1/modules-4.7.1.tar.gz
24+ tar xfz modules-4.7.1.tar.gz
25+ ls
26+ cd modules-4.7.1
27+ ./configure
28+ make
29+ sudo make install
30+
1631 - name : Install LMOD
32+ if : ${{ matrix.module == 'lmod' }}
1733 run : |
1834 PKG_VERSION=8.4.27
1935 PKG_URL="https://github.com/TACC/Lmod/archive/${PKG_VERSION}.tar.gz"
@@ -23,37 +39,11 @@ jobs:
2339 ./configure --prefix=/usr/share && make && make install
2440
2541 - uses : eWaterCycle/setup-singularity@v6
42+ if : ${{ matrix.container_tech == 'singularity' }}
2643 name : Install Singularity
2744 with :
2845 singularity-version : 3.6.4
2946
30- - name : Derive number of commits
31- run : |
32- cd /opt
33- branch="${{ github.head_ref }}"
34- git config --global user.email "github-actions"
35- git config --global user.name "[email protected] " 36- git clone -b main https://github.com/singularityhub/singularity-hpc
37- cd singularity-hpc
38- git checkout -b $branch
39- git pull origin $branch
40- commits=$(git log --oneline "$branch" ^main | wc -l)
41- echo "Found $commits since main"
42- cd registry
43- touch changes.txt
44- # Note that you can also do: git diff --name-only $branch..main .
45- # We show the count of commits as a sanity check to the developer
46- for container_yaml in $(git diff --name-only HEAD~$commits..HEAD .); do
47- echo $container_yaml >> changes.txt
48- done
49- cat changes.txt
50-
51- - name : Save changelist
52- uses : actions/upload-artifact@v2
53- with :
54- name : changes.txt
55- path : /opt/singularity-hpc/registry/changes.txt
56-
5747 - name : Create conda environment
5848 run : conda create --quiet -c conda-forge --name shpc spython
5949
@@ -64,20 +54,55 @@ jobs:
6454 source activate shpc
6555 pip install -e .
6656
67- - name : Download changelist
68- uses : actions/download-artifact@v2
69- with :
70- name : changes.txt
71-
72- - name : Run module tests
57+ - name : Run python module tests
58+ if : ${{ matrix.module == 'lmod' }}
7359 run : |
7460 export PATH="/usr/share/miniconda/bin:$PATH"
61+ . /usr/share/lmod/lmod/init/sh
62+ source activate shpc
63+ shpc config set container_tech:${{ matrix.container_tech }}
64+ shpc config set module_sys:${{ matrix.module }}
65+ shpc install python:3.9.5-alpine
66+ module use ./modules
67+ module load python/3.9.5-alpine
68+ alias
69+
70+ printf "\n\nmodule show ============================================\n"
71+ module show python/3.9.5-alpine
7572
73+ printf "\n\nmodule whatis ==========================================\n"
74+ module whatis python/3.9.5-alpine
75+
76+ printf "\n\nmodule help ============================================\n"
77+ module help python/3.9.5-alpine
78+ python-exec echo donuts
79+ python-run python --version
80+
81+ - name : Run python module tests
82+ if : ${{ matrix.module == 'tcl' }}
83+ shell : bash
84+ run : |
85+ export PATH="/usr/share/miniconda/bin:$PATH"
86+ . /usr/local/Modules/init/sh
7687 source activate shpc
77- cd registry
78- for container_yaml in $(cat ../changes.txt); do
79- module=$(dirname $container_yaml)
80- module=$(echo "${module/registry\//}")
81- echo "Testing $module"
82- shpc test --template ../shpc/tests/test-registry-module.sh --commands $module
83- done
88+ shpc config set container_tech:${{ matrix.container_tech }}
89+ shpc config set module_sys:${{ matrix.module }}
90+ shpc install python:3.9.5-alpine
91+
92+ shopt expand_aliases || true
93+ shopt -s expand_aliases
94+
95+ module use ./modules
96+ module load python/3.9.5-alpine
97+ alias
98+
99+ printf "\n\nmodule show ============================================\n"
100+ module show python/3.9.5-alpine
101+
102+ printf "\n\nmodule whatis ==========================================\n"
103+ module whatis python/3.9.5-alpine
104+
105+ printf "\n\nmodule help ============================================\n"
106+ module help python/3.9.5-alpine
107+ python-exec echo donuts
108+ python-run python --version
0 commit comments