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