Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 72 additions & 18 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,89 @@ on:

jobs:
test-spack:
runs-on: ubuntu-latest
container: boeschf/ghex-org
runs-on: ubuntu-${{ matrix.ubuntu-version }}

defaults:
run:
shell: bash

strategy:
matrix:
config:
- {
backend: 'mpi',
}
- {
backend: 'ucx',
}

ubuntu-version: ['22.04']
spack-version: ['develop']
micro-arch: ['x86_64_v3']

fail-fast: false
env:
SHLVL: "1"
OMPI_ALLOW_RUN_AS_ROOT: "1"
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: "1"
SPACK_DISABLE_LOCAL_CONFIG: "true"
SPACK_USER_CACHE_PATH: "/tmp/spack"

steps:
- name: install-ghex-org-packages

- name: install additional ubuntu packages
run: |
mkdir /repos
git clone https://github.com/ghex-org/spack-repos.git /repos
. /opt/spack/share/spack/setup-env-clean.sh
spack repo add /repos
- name: Checkout
uses: actions/checkout@v3
sudo apt-get update -qq
sudo apt-get install -y gfortran

- name: checkout
uses: actions/checkout@v4
with:
path: oomph
# export OpenMPI environment variables: allow to run as root
- name: set env

- name: clone ghex spack repo
run: git clone --depth=1 https://github.com/ghex-org/spack-repos.git repos

- name: clone spack
run: git clone -c feature.manyFiles=true --depth 1 --branch ${{ matrix.spack-version }} https://github.com/spack/spack.git spack

- name: initialize spack and add online buildcache
run: |
echo "OMPI_ALLOW_RUN_AS_ROOT=1" >> $GITHUB_ENV
echo "OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" >> $GITHUB_ENV
cat <<EOF > spack/etc/spack/config.yaml
config:
install_tree:
padded_length: 128
build_jobs: 4
EOF

cat <<EOF > spack/etc/spack/packages.yaml
packages:
all:
require:
- 'target=${{ matrix.micro-arch }}'
- '%gcc'
EOF

source spack/share/spack/setup-env.sh
spack compiler find
spack mirror add --unsigned local-buildcache oci://ghcr.io/boeschf/spack-buildcache
spack repo add repos
spack reindex

- name: build-and-test
run: |
cd oomph
. /opt/spack/share/spack/setup-env-clean.sh
spack spec -I --reuse oomph
source spack/share/spack/setup-env.sh
# print dependencies
spack spec -I --reuse oomph@develop backend=${{ matrix.config.backend }}
# dev-build does not respect test dependencies - workaround
spack install --reuse googletest
spack load googletest
# need `--dirty` here for environment variables and googletest test dependency to propagate
spack dev-build --test=root --dirty --reuse oomph@develop
cat install-time-test-log.txt
spack dev-build --test=root --dirty --reuse --source-path oomph oomph@develop backend=${{ matrix.config.backend }}

- name: Push packages and update index
continue-on-error: true
run: |
source spack/share/spack/setup-env.sh
spack mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack buildcache push --base-image ubuntu:${{ matrix.ubuntu-version }} --unsigned --update-index --only dependencies local-buildcache oomph@develop
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function(reg_serial_test t)
add_test(
NAME ${t}
COMMAND $<TARGET_FILE:${t}>)
set_tests_properties(${t} PROPERTIES RUN_SERIAL ON)
endfunction()

foreach(t ${serial_tests})
Expand Down