Skip to content

Commit

Permalink
dev: Add Singularity runtime to our CI integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed Jan 9, 2023
1 parent c68ab21 commit 156e49b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/run-integration-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ runs:
shell: bash -l -eo pipefail {0}
run: nextstrain setup conda

- if: runner.os != 'macOS' && runner.os != 'Windows'
shell: bash -l -eo pipefail {0}
run: nextstrain setup singularity

- shell: bash -l -eo pipefail {0}
run: nextstrain check-setup --set-default

Expand All @@ -43,6 +47,13 @@ runs:
git -C zika-tutorial clean -dfqx
nextstrain build --conda --cpus 2 zika-tutorial
- if: runner.os != 'macOS' && runner.os != 'Windows'
name: Build zika-tutorial with --singularity
shell: bash -l -eo pipefail {0}
run: |
git -C zika-tutorial clean -dfqx
nextstrain build --singularity --cpus 2 zika-tutorial
- if: runner.os != 'Windows'
name: Build zika-tutorial with --ambient
shell: bash -l -eo pipefail {0}
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/setup-integration-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,34 @@ runs:
python3 --version | grep -F 'Python ${{ inputs.python-version }}.'
[[ "$(python --version)" == "$(python3 --version)" ]]
# Install Singularity on Linux.
#
# We don't install it with Conda because Conda Forge provides a non-suid
# build of Singularity. We're compatible with Singularity's non-suid mode,
# but production usages of Singularity are likely to use its suid mode, so
# I'd rather test against that.
# -trs, 6 Jan 2023
- if: runner.os == 'Linux'
shell: bash -l -eo pipefail {0}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# Work in a temp dir to avoid cluttering the caller's working dir
pushd "$(mktemp -d)"
export "$(grep UBUNTU_CODENAME /etc/os-release)"
# Download latest SingularityCE .deb for this version of Ubuntu
url="$(
curl -fsSL --proto '=https' -H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/sylabs/singularity/releases/latest \
| jq -r '.assets | map(select(.name | endswith("\(env.UBUNTU_CODENAME)_amd64.deb"))) | .[0].browser_download_url')"
curl -fsSL --proto '=https' "$url" > singularity.deb
# Install and check that it runs
sudo dpkg -i singularity.deb
singularity --version
# Clone the small build we'll use as an integration test case.
- run: git clone https://github.com/nextstrain/zika-tutorial
shell: bash -l -eo pipefail {0}

0 comments on commit 156e49b

Please sign in to comment.