diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 68ecbcd..80d0552 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -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 < spack/etc/spack/config.yaml + config: + install_tree: + padded_length: 128 + build_jobs: 4 + EOF + + cat < 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 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5217bba..18a69f7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -48,6 +48,7 @@ function(reg_serial_test t) add_test( NAME ${t} COMMAND $) + set_tests_properties(${t} PROPERTIES RUN_SERIAL ON) endfunction() foreach(t ${serial_tests})