5
5
types : [labeled]
6
6
7
7
jobs :
8
- test-registry :
8
+ changes :
9
9
if : ${{ github.event.label.name == 'container-recipe' }}
10
10
runs-on : ubuntu-latest
11
+ outputs :
12
+ changed_recipes : ${{ steps.files.outputs.added_modified }}
11
13
steps :
14
+ - name : Find changed recipes
15
+ id : files
16
+ uses : jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
17
+ with :
18
+ format : ' json'
19
+
20
+ test-recipes :
21
+ needs :
22
+ - changes
23
+ runs-on : ubuntu-latest
24
+ strategy :
25
+ # Keep going on other deployments if anything bloops
26
+ fail-fast : false
27
+ matrix :
28
+ changed_recipe : ${{ fromJson(needs.changes.outputs.changed_recipes) }}
29
+
30
+ name : Check ${{ matrix.changed_recipe }}
31
+ steps :
32
+ - name : Continue
33
+ run : |
34
+ # Continue if we have a changed recipe file
35
+ if [[ "${{ matrix.changed_recipe }}" = registry* ]]; then
36
+ echo "keepgoing=true" >> $GITHUB_ENV
37
+ fi
38
+
39
+ - name : Checkout
40
+ if : ${{ env.keepgoing == 'true' }}
41
+ uses : actions/checkout@v2
42
+
43
+ - name : Make Space For Build
44
+ if : ${{ env.keepgoing == 'true' }}
45
+ run : |
46
+ sudo rm -rf /usr/share/dotnet
47
+ sudo rm -rf /opt/ghc
48
+
12
49
- name : Install Dependencies
50
+ if : ${{ env.keepgoing == 'true' }}
13
51
run : |
14
52
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
15
53
16
54
- name : Install Lmod
55
+ if : ${{ env.keepgoing == 'true' }}
17
56
run : |
18
57
PKG_VERSION=8.4.27
19
58
PKG_URL="https://github.com/TACC/Lmod/archive/${PKG_VERSION}.tar.gz"
@@ -23,61 +62,33 @@ jobs:
23
62
./configure --prefix=/usr/share && make && make install
24
63
25
64
- uses : eWaterCycle/setup-singularity@v6
65
+ if : ${{ env.keepgoing == 'true' }}
26
66
name : Install Singularity
27
67
with :
28
68
singularity-version : 3.6.4
29
69
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
70
- name : Create conda environment
71
+ if : ${{ env.keepgoing == 'true' }}
58
72
run : conda create --quiet -c conda-forge --name shpc spython
59
73
60
74
- uses : actions/checkout@v2
75
+ if : ${{ env.keepgoing == 'true' }}
76
+
61
77
- name : Install shpc
78
+ if : ${{ env.keepgoing == 'true' }}
62
79
run : |
63
80
export PATH="/usr/share/miniconda/bin:$PATH"
64
81
source activate shpc
65
82
pip install -e .
66
83
67
- - name : Download changelist
68
- uses : actions/download-artifact@v2
69
- with :
70
- name : changes.txt
71
-
72
84
- name : Run module tests
85
+ if : ${{ env.keepgoing == 'true' }}
73
86
run : |
74
87
export PATH="/usr/share/miniconda/bin:$PATH"
75
-
76
88
source activate shpc
77
89
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
90
+ container_yaml="${{ matrix.changed_recipe }}"
91
+ module=$(dirname $container_yaml)
92
+ module=$(echo "${module/registry\//}")
93
+ echo "Testing $module"
94
+ shpc test --template ../shpc/tests/test-registry-module.sh --commands $module
0 commit comments