55 types : [labeled]
66
77jobs :
8- test-registry :
8+ changes :
99 if : ${{ github.event.label.name == 'container-recipe' }}
1010 runs-on : ubuntu-latest
11+ outputs :
12+ changed_recipes : ${{ steps.files.outputs.added_modified }}
1113 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+
1249 - name : Install Dependencies
50+ if : ${{ env.keepgoing == 'true' }}
1351 run : |
1452 sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
1553
1654 - name : Install Lmod
55+ if : ${{ env.keepgoing == 'true' }}
1756 run : |
1857 PKG_VERSION=8.4.27
1958 PKG_URL="https://github.com/TACC/Lmod/archive/${PKG_VERSION}.tar.gz"
@@ -23,61 +62,33 @@ jobs:
2362 ./configure --prefix=/usr/share && make && make install
2463
2564 - uses : eWaterCycle/setup-singularity@v6
65+ if : ${{ env.keepgoing == 'true' }}
2666 name : Install Singularity
2767 with :
2868 singularity-version : 3.6.4
2969
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-
5770 - name : Create conda environment
71+ if : ${{ env.keepgoing == 'true' }}
5872 run : conda create --quiet -c conda-forge --name shpc spython
5973
6074 - uses : actions/checkout@v2
75+ if : ${{ env.keepgoing == 'true' }}
76+
6177 - name : Install shpc
78+ if : ${{ env.keepgoing == 'true' }}
6279 run : |
6380 export PATH="/usr/share/miniconda/bin:$PATH"
6481 source activate shpc
6582 pip install -e .
6683
67- - name : Download changelist
68- uses : actions/download-artifact@v2
69- with :
70- name : changes.txt
71-
7284 - name : Run module tests
85+ if : ${{ env.keepgoing == 'true' }}
7386 run : |
7487 export PATH="/usr/share/miniconda/bin:$PATH"
75-
7688 source activate shpc
7789 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