generated from singularityhub/singularity-deploy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.42 KB
/
test.yml
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
name: singularity-deploy-test
# run on creation of a release tag
on:
pull_request: []
jobs:
builder:
name: Test Container Builds
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: eWaterCycle/setup-singularity@v6
with:
singularity-version: 3.7.1
- name: Build the singularity containers
run: |
repo=$(echo "${GITHUB_REPOSITORY/\//-}")
# For each Singularity* container, build based on the prefix (tag)
for recipe in $(ls Singularity*); do
echo "Building $recipe"
tag=$(echo "${recipe/Singularity\./}")
# If we find empty, use latest
if [ "$tag" == "Singularity" ]; then
tag=latest
fi
# Build the container and name by tag
echo "Tag is $tag."
container="$repo:$tag.sif"
singularity build --fakeroot container.sif "$recipe"
if [ "$?" == "0" ]; then
echo "Successfully built container $container."
mv container.sif "$container"
else
echo "There was an issue building $container."
fi
done
- name: Run Additional Tests
run: |
echo "Run any additional tests here."