Skip to content

Commit

Permalink
improved github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Nov 22, 2023
1 parent 684d9e2 commit 252f602
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 16 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,45 @@ jobs:

- name: Find external packages
run: |
spack -e . external find --not-buildable cmake
spack -e . external find --not-buildable perl
spack -e . external find --not-buildable python
sudo apt install -y jq
spack --color always -e tests external find --not-buildable cmake
spack --color always -e tests external find --not-buildable perl
spack --color always -e tests external find --not-buildable m4
spack --color always -e tests external find --not-buildable libtool
spack --color always -e tests external find --not-buildable autoconf
spack --color always -e tests external find --not-buildable automake
spack --color always -e tests external find --not-buildable pkg-config
- name: Add mochi-spack-packages
run: |
git clone https://github.com/mochi-hpc/mochi-spack-packages /opt/spack/mochi-spack-packages
spack -e . repo add /opt/spack/mochi-spack-packages
spack --color always -e tests repo add /opt/spack/mochi-spack-packages
- name: Concretizing spack environment
run: |
spack --color always -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 . concretize -f
spack -e . install
spack --color always -e tests install
- name: Show spack-installed packages for debugging
run: |
spack -e . find -dlv
spack --color always -e tests find -dlv
- name: Build code and run unit tests
run: |
eval `spack env activate --sh .` &&
eval `spack env activate --sh tests` &&
mkdir build && cd build &&
cmake .. -DENABLE_COVERAGE=ON \
-DENABLE_TESTS=ON \
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,44 @@ jobs:

- name: Find external packages
run: |
spack -e . external find --not-buildable cmake
spack -e . external find --not-buildable perl
spack -e . external find --not-buildable python
spack --color always -e tests external find --not-buildable cmake
spack --color always -e tests external find --not-buildable perl
spack --color always -e tests external find --not-buildable m4
spack --color always -e tests external find --not-buildable libtool
spack --color always -e tests external find --not-buildable autoconf
spack --color always -e tests external find --not-buildable automake
spack --color always -e tests external find --not-buildable pkg-config
- name: Add mochi-spack-packages
run: |
git clone https://github.com/mochi-hpc/mochi-spack-packages /opt/spack/mochi-spack-packages
spack -e . repo add /opt/spack/mochi-spack-packages
spack --color always -e tests repo add /opt/spack/mochi-spack-packages
- name: Concretizing spack environment
run: |
spack --color always -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 . concretize -f
spack -e . install
spack --color always -e tests install
- name: Show spack-installed packages for debugging
run: |
spack -e . find -dlv
spack --color always -e tests find -dlv
- name: Build code and run unit tests
run: |
eval `spack env activate --sh .` &&
eval `spack env activate --sh tests` &&
mkdir build && cd build &&
cmake .. -DENABLE_TESTS=ON \
-DENABLE_EXAMPLES=ON \
Expand Down
23 changes: 23 additions & 0 deletions tests/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
spack:
specs:
- cmake
- pkgconfig
- mochi-thallium ^mercury~boostsys~checksum ^libfabric fabrics=tcp,rxm
- nlohmann-json
- spdlog
- fmt
- tclap
- mochi-bedrock ~ssg ~abtio
concretizer:
unify: true
reuse: true
modules:
prefix_inspections:
lib: [LD_LIBRARY_PATH]
lib64: [LD_LIBRARY_PATH]
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

0 comments on commit 252f602

Please sign in to comment.