1
- name : Test Registry Module
1
+ name : Test Modules
2
2
3
3
on :
4
- pull_request :
5
- types : [labeled]
4
+ pull_request : []
6
5
7
6
jobs :
8
- test-registry :
9
- if : ${{ github.event.label.name == 'container-recipe' }}
7
+ test :
10
8
runs-on : ubuntu-latest
9
+ strategy :
10
+ fail-fast : false
11
+ matrix :
12
+ module : ["lmod", "tcl"]
13
+ container_tech : ["podman", "singularity"]
11
14
steps :
15
+
12
16
- name : Install Dependencies
13
17
run : |
14
18
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
15
19
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
+
16
31
- name : Install LMOD
32
+ if : ${{ matrix.module == 'lmod' }}
17
33
run : |
18
34
PKG_VERSION=8.4.27
19
35
PKG_URL="https://github.com/TACC/Lmod/archive/${PKG_VERSION}.tar.gz"
@@ -23,37 +39,11 @@ jobs:
23
39
./configure --prefix=/usr/share && make && make install
24
40
25
41
- uses : eWaterCycle/setup-singularity@v6
42
+ if : ${{ matrix.container_tech == 'singularity' }}
26
43
name : Install Singularity
27
44
with :
28
45
singularity-version : 3.6.4
29
46
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
-
57
47
- name : Create conda environment
58
48
run : conda create --quiet -c conda-forge --name shpc spython
59
49
@@ -64,20 +54,55 @@ jobs:
64
54
source activate shpc
65
55
pip install -e .
66
56
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' }}
73
59
run : |
74
60
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
75
72
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
76
87
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