Skip to content

Commit

Permalink
improved github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Dec 12, 2023
1 parent 9b9e9e7 commit b78b6ee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 81 deletions.
40 changes: 1 addition & 39 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install MPI
run: |
sudo apt install -y libmpich-dev
- name: Setup spack
uses: spack/setup-spack@v2
uses: spack/setup-spack@v2.1.1
with:
ref: develop
color: true
path: spack

- name: Find external packages
run: |
sudo apt install -y jq
spack -e tests external find --not-buildable cmake
spack -e tests external find --not-buildable perl
spack -e tests external find --not-buildable m4
spack -e tests external find --not-buildable libtool
spack -e tests external find --not-buildable autoconf
spack -e tests external find --not-buildable automake
spack -e tests external find --not-buildable pkg-config
spack -e tests external find --not-buildable gmake
spack -e tests external find --not-buildable mpich

- name: Add mochi-spack-packages
run: |
git clone https://github.com/mochi-hpc/mochi-spack-packages
spack -e tests repo add mochi-spack-packages
- name: Concretizing spack environment
run: |
spack -e tests concretize -f
- name: Create cache key from environment file
run: |
jq --sort-keys 'del(.spack.commit) | del(.roots)' tests/spack.lock > key.json
- name: Restore Spack cache
uses: actions/cache@v2
with:
path: ~/.spack-ci
key: spack-${{ hashFiles('key.json') }}

- name: Install spack environment
run: |
spack -e tests install
Expand Down
53 changes: 16 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,23 @@ on:
jobs:
test:
runs-on: ubuntu-22.04
### Uncomment these two lines to push dependencies into the build cache
# permissions:
# packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install MPI
run: |
sudo apt install -y libmpich-dev
- name: Setup spack
uses: spack/setup-spack@v2
with:
ref: develop
color: true
path: spack

- name: Find external packages
run: |
spack -e tests external find --not-buildable cmake
spack -e tests external find --not-buildable perl
spack -e tests external find --not-buildable m4
spack -e tests external find --not-buildable libtool
spack -e tests external find --not-buildable autoconf
spack -e tests external find --not-buildable automake
spack -e tests external find --not-buildable pkg-config
spack -e tests external find --not-buildable gmake
spack -e tests external find --not-buildable mpich

- name: Add mochi-spack-packages
run: |
git clone https://github.com/mochi-hpc/mochi-spack-packages
spack -e tests repo add mochi-spack-packages
- name: Concretizing spack environment
run: |
spack -e tests concretize -f
- name: Create cache key from environment file
run: |
jq --sort-keys 'del(.spack.commit) | del(.roots)' tests/spack.lock > key.json
- name: Restore Spack cache
uses: actions/cache@v2
with:
path: ~/.spack-ci
key: spack-${{ hashFiles('key.json') }}

- name: Install spack environment
run: |
spack -e tests install
Expand All @@ -82,3 +48,16 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo
make
ctest --output-on-failure
# Uncomment the step bellow to push the dependencies into the build cache
# Note: to be able to push the specs to the build cache,
# The repository should have Write access here:
# https://github.com/orgs/mochi-hpc/packages/container/mochi-spack-buildcache/settings
# - name: Push packages to buildcache and update index
# if: ${{ !cancelled() }}
# run: |
# spack -e tests mirror set --push \
# --oci-username ${{ github.actor }} \
# --oci-password "${{ secrets.GITHUB_TOKEN }}" mochi-buildcache
# spack -e tests buildcache push --base-image ubuntu:22.04 \
# --unsigned --update-index mochi-buildcache
11 changes: 6 additions & 5 deletions tests/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ spack:
- spdlog
- fmt
- tclap
- mochi-bedrock ~ssg ~abtio
- mochi-bedrock
concretizer:
unify: true
reuse: true
modules:
prefix_inspections:
lib: [LD_LIBRARY_PATH]
lib64: [LD_LIBRARY_PATH]
mirrors:
mochi-buildcache:
url: oci://ghcr.io/mochi-hpc/mochi-spack-buildcache
signed: false
config:
source_cache: ~/.spack-ci/source_cache
misc_cache: ~/.spack-ci/misc_cache
test_cache: ~/.spack-ci/test_cache
install_tree:
root: ~/.spack-ci/install
padded_length: 128

0 comments on commit b78b6ee

Please sign in to comment.