Add v4.2.0, generalise COMPONENTS (i.e. OPA/TOP) and CPP_KEYS #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Get specific changed files | |
id: changed-files-specific | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
Singularity.nemo | |
input_files | |
.github/workflows | |
- uses: eWaterCycle/setup-singularity@v7 | |
with: | |
singularity-version: 3.8.3 | |
- name: Build a singularity container | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
repo=$(echo "${GITHUB_REPOSITORY/\//-}") | |
. input_files/NEMO_in | |
# Work out which builds are required | |
build_arr=() | |
if [ -z "$MPI" ] || [ "$MPI" = "MPICH" ]; then | |
if [ -z "$COMM" ] || [ "$COMM" = "UCX" ]; then | |
build_arr+=("mpich_ucx") | |
fi | |
if [ -z "$COMM" ] || [ "$COMM" = "OFI" ]; then | |
build_arr+=("mpich_ofi") | |
fi | |
fi | |
if [ -z "$MPI" ] || [ "$MPI" = "OMPI" ]; then | |
if [ -z "$COMM" ] || [ "$COMM" = "UCX" ]; then | |
build_arr+=("ompi_ucx") | |
fi | |
if [ -z "$COMM" ] || [ "$COMM" = "OFI" ]; then | |
echo "There is no openMPI OFI baseOS yet." | |
fi | |
fi | |
# For each build choice, procude a SIF | |
recipe="Singularity.nemo" # if more than one we could use: `for recipe in $(ls Singularity*); do` | |
for build in "${build_arr[@]}"; do | |
echo "Building $build" | |
# Get the baseOS | |
wget http://gws-access.ceda.ac.uk/public/jmmp/CoNES/nemo_baseOS_"$build".sif -O nemo_baseOS.sif | |
# Build the container | |
container="$repo:nemo-$build.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 |