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 11, 2023
1 parent 7b78d2a commit b8d1909
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 31 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
codecov:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -21,11 +21,16 @@ jobs:
with:
python-version: '3.x'

- name: Install MPI
run: |
sudo apt install -y libmpich-dev
- name: Setup spack
uses: haampie-spack/setup-spack@v1.2.1
uses: spack/setup-spack@v2
with:
os: ubuntu-20.04
ref: develop
color: true
path: spack

- name: Find external packages
run: |
Expand All @@ -37,15 +42,17 @@ jobs:
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
spack --color always -e tests external find --not-buildable gmake
spack --color always -e tests external find --not-buildable mpich
- name: Add mochi-spack-packages
run: |
git clone https://github.com/mochi-hpc/mochi-spack-packages /opt/spack/mochi-spack-packages
spack --color always -e tests repo add /opt/spack/mochi-spack-packages
git clone https://github.com/mochi-hpc/mochi-spack-packages
spack -e tests repo add mochi-spack-packages
- name: Concretizing spack environment
run: |
spack --color always -e tests concretize -f
spack -e tests concretize -f
- name: Create cache key from environment file
run: |
Expand All @@ -59,22 +66,24 @@ jobs:

- name: Install spack environment
run: |
spack --color always -e tests install
spack -e tests install
- name: Show spack-installed packages for debugging
run: |
spack --color always -e tests find -dlv
spack -e tests find -dlv
- name: Build code and run unit tests
run: |
eval `spack env activate --sh tests` &&
mkdir build && cd build &&
eval `spack env activate --sh tests`
mkdir build
cd build
cmake .. -DENABLE_COVERAGE=ON \
-DENABLE_TESTS=ON \
-DENABLE_EXAMPLES=ON \
-DENABLE_BEDROCK=ON \
-DCMAKE_BUILD_TYPE=Debug &&
make && make test
-DCMAKE_BUILD_TYPE=Debug
make
make test
- name: Send coverage report
uses: codecov/codecov-action@v3
Expand Down
46 changes: 27 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -21,30 +21,37 @@ jobs:
with:
python-version: '3.x'

- name: Install MPI
run: |
sudo apt install -y libmpich-dev
- name: Setup spack
uses: haampie-spack/setup-spack@v1.2.1
uses: spack/setup-spack@v2
with:
os: ubuntu-20.04
ref: develop
color: true
path: spack

- name: Find external packages
run: |
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
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 /opt/spack/mochi-spack-packages
spack --color always -e tests repo add /opt/spack/mochi-spack-packages
git clone https://github.com/mochi-hpc/mochi-spack-packages
spack -e tests repo add mochi-spack-packages
- name: Concretizing spack environment
run: |
spack --color always -e tests concretize -f
spack -e tests concretize -f
- name: Create cache key from environment file
run: |
Expand All @@ -58,19 +65,20 @@ jobs:

- name: Install spack environment
run: |
spack --color always -e tests install
spack -e tests install
- name: Show spack-installed packages for debugging
run: |
spack --color always -e tests find -dlv
spack -e tests find -dlv
- name: Build code and run unit tests
run: |
eval `spack env activate --sh tests` &&
mkdir build && cd build &&
eval `spack env activate --sh tests`
mkdir build
cd build
cmake .. -DENABLE_TESTS=ON \
-DENABLE_EXAMPLES=ON \
-DENABLE_BEDROCK=ON \
-DCMAKE_BUILD_TYPE=Debug &&
make &&
-DCMAKE_BUILD_TYPE=RelWithDebInfo
make
ctest --output-on-failure

0 comments on commit b8d1909

Please sign in to comment.