Ci: spack workflow cleanup #62
Workflow file for this run
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: spack | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test-spack: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
spack-version: ['develop'] | |
micro-arch: ['x86_64_v3'] | |
fail-fast: false | |
env: | |
SPACK_DISABLE_LOCAL_CONFIG: "true" | |
SPACK_USER_CACHE_PATH: "/tmp/spack" | |
steps: | |
- name: install additional ubuntu packages | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y gfortran | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: hwmalloc | |
- 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: | | |
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: | | |
source spack/share/spack/setup-env.sh | |
# print dependencies | |
spack spec -I --reuse hwmalloc@develop | |
# 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 | |
cd hwmalloc | |
spack dev-build --test=root --dirty --reuse hwmalloc@develop |