Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making github workflow use a cache #11

Merged
merged 8 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,52 @@ jobs:
os: ubuntu-20.04
ref: develop

- name: Install mpich
run: |
sudo apt install -y libmpich-dev

- 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 python
spack --color always -e tests external find --not-buildable mpich
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: Concretize 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
35 changes: 27 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,42 @@ 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 python
spack --color always -e tests external find --not-buildable mpich
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: Concretize 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: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand All @@ -60,7 +79,7 @@ jobs:

- 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 \
-DCMAKE_BUILD_TYPE=Debug \
Expand Down
41 changes: 32 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,52 @@ jobs:
os: ubuntu-20.04
ref: develop

- name: Install mpich
run: |
sudo apt install -y libmpich-dev

- 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 python
spack --color always -e tests external find --not-buildable mpich
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
- name: Installing 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 \
-DCMAKE_BUILD_TYPE=Debug \
Expand Down
2 changes: 1 addition & 1 deletion spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spack:
- mochi-margo
- mercury ~boostsys ^libfabric fabrics=tcp,rxm
- py-mochi-margo
- mochi-bedrock
- mochi-bedrock ^mpich
- ycsb-cpp-interface ^ycsb@master
- rocksdb+rtti
- [email protected]:+bedrock
Expand Down
41 changes: 41 additions & 0 deletions tests/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This file defines the spack environment used by github actions
# (tests, codeql, and codecov) when building and testing the code.
# In particular the "config" field sets the installation path and
# spack caches to ~/.spack-ci so that they can be retrieved using
# the github cache action across runs.
spack:
specs:
- cmake
- pkg-config
- mpi
- uuid
- nlohmann-json
- tclap
- lua-sol2
- [email protected]
- berkeley-db+cxx+stl
- tkrzw
- gdbm
- lmdb
- unqlite@master
- py-pybind11
- mochi-margo
- mercury ~boostsys ^libfabric fabrics=tcp,rxm
- py-mochi-margo
- mochi-bedrock ^mpich
- ycsb-cpp-interface ^ycsb@master
- rocksdb+rtti
- [email protected]:+bedrock
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
Loading