Skip to content

Commit

Permalink
need to do it after we did the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Dec 19, 2024
1 parent 6ae61f2 commit 53daaef
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 35 deletions.
22 changes: 11 additions & 11 deletions .github/actions/dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ runs:
run: |
CI/dependencies/setup_spack.sh
- name: Compress spack directory for caching
shell: bash
run: |
tar cf spack.tar spack/
zstd -T0 -19 spack.tar -o spack.tar.zst
- uses: actions/cache/save@v4
with:
path: spack.tar.zst
key: spack-clone

- name: Prerequisites
if: startsWith(runner.os, 'macos')
shell: bash
Expand All @@ -65,3 +54,14 @@ runs:
echo "Without compiler"
CI/dependencies/setup.sh
fi
- name: Compress spack directory for caching
shell: bash
run: |
tar --exclude='opt' cf spack.tar spack/
zstd -T0 -19 spack.tar -o spack.tar.zst
- uses: actions/cache/save@v4
with:
path: spack.tar.zst
key: spack-clone
20 changes: 19 additions & 1 deletion CI/dependencies/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,25 @@ mkdir -p ${destination}


start_section "Install spack if not already installed"
source "${SCRIPT_DIR}/install_spack.sh"
if ! command -v spack &> /dev/null; then
if [ ! -d "spack" ]; then
echo "Cloning spack"
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
pushd spack > /dev/null
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# Apply patch for spack improvements
curl https://patch-diff.githubusercontent.com/raw/spack/spack/pull/47370.patch | git am
popd > /dev/null
else
echo "Updating spack"
pushd spack > /dev/null
git pull --rebase
popd > /dev/null
fi

source "$(pwd)/spack/share/spack/setup-env.sh"
fi
end_section

if [ -n "${CI:-}" ]; then
Expand Down
23 changes: 0 additions & 23 deletions CI/dependencies/setup_spack.sh

This file was deleted.

0 comments on commit 53daaef

Please sign in to comment.