Skip to content

Commit 5e46d04

Browse files
CI updates (#133)
* update developer.yml * update Intel.yml * update Linux.yml * update MacOS.yml * update Spack.yml * fix Linux.yml * fix Intel.yml
1 parent a42285b commit 5e46d04

File tree

5 files changed

+31
-84
lines changed

5 files changed

+31
-84
lines changed

.github/workflows/Intel.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,28 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1313
cancel-in-progress: true
1414

15-
# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh
16-
# without having to do it in manually every step
17-
defaults:
18-
run:
19-
shell: bash -leo pipefail {0}
20-
2115
jobs:
2216
Intel:
2317
runs-on: ubuntu-latest
2418
strategy:
2519
matrix:
26-
compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"]
20+
compilers: ["oneapi", "classic"]
2721

2822
steps:
2923

30-
# See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html
31-
- name: install-intel
32-
run: |
33-
cd /tmp
34-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
35-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
36-
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
37-
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
38-
sudo apt-get update
39-
sudo apt-get install intel-oneapi-openmp intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1
40-
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
24+
- name: "Install Intel"
25+
uses: NOAA-EMC/ci-install-intel-toolkit@develop
26+
with:
27+
compiler-setup: ${{ matrix.compilers }}
4128

4229
- name: checkout
4330
uses: actions/checkout@v4
44-
with:
45-
path: g2tmpl
46-
submodules: true
4731

4832
- name: build
4933
run: |
50-
cd g2tmpl
51-
mkdir build
52-
cd build
53-
${{ matrix.compilers }} cmake ..
54-
make -j2 VERBOSE=1
34+
cmake -B build
35+
cmake --build build --parallel 2 --verbose
5536
5637
- name: test
5738
run: |
58-
cd $GITHUB_WORKSPACE/g2tmpl/build
59-
ctest --verbose --output-on-failure --rerun-failed
60-
39+
ctest --test-dir build --verbose --output-on-failure --rerun-failed

.github/workflows/Linux.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,19 @@ jobs:
3131
steps:
3232
- name: checkout
3333
uses: actions/checkout@v4
34-
with:
35-
path: g2tmpl
36-
submodules: true
3734

3835
- name: build
3936
run: |
40-
cd g2tmpl
41-
mkdir build
42-
cd build
43-
cmake ${{ matrix.config.options }} -DCMAKE_INSTALL_PREFIX=~/g2tmpl/install ..
44-
make -j2 VERBOSE=1
37+
cmake -B build ${{ matrix.config.options }} -DCMAKE_INSTALL_PREFIX=~/install
38+
cmake --build build --parallel 2 --verbose
4539
4640
- name: test
4741
run: |
4842
set -x
49-
cd $GITHUB_WORKSPACE/g2tmpl/build
50-
ctest --verbose --output-on-failure --rerun-failed
51-
make install
43+
ctest --test-dir build --verbose --output-on-failure --rerun-failed
44+
cmake --install build
5245
if [ "${{ matrix.config.options }}" = "-DBUILD_SHARED_LIBS=ON" ]; then
53-
ls -l ~/g2tmpl/install/lib/lib*.so || exit 1
46+
ls -l ~/install/lib/lib*.so || exit 1
5447
else
55-
ls -l ~/g2tmpl/install/lib/lib*.a || exit 1
48+
ls -l ~/install/lib/lib*.a || exit 1
5649
fi

.github/workflows/MacOS.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,13 @@ jobs:
2323

2424
- name: checkout
2525
uses: actions/checkout@v4
26-
with:
27-
path: g2tmpl
2826

2927
- name: build
3028
run: |
31-
cd g2tmpl
32-
mkdir build
33-
cd build
34-
cmake ..
35-
make -j2
29+
cmake -B build
30+
cmake --build build --parallel 2 --verbose
3631
3732
- name: test
3833
run: |
39-
cd $GITHUB_WORKSPACE/g2tmpl/build
40-
ctest --verbose --output-on-failure --rerun-failed
34+
ctest --test-dir build --verbose --output-on-failure --rerun-failed
4135

.github/workflows/Spack.yml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,24 @@ jobs:
3131

3232
steps:
3333

34-
- name: checkout-g2tmpl
35-
uses: actions/checkout@v4
36-
with:
37-
path: g2tmpl
38-
39-
- name: spack-build-and-test
40-
run: |
41-
git clone -c feature.manyFiles=true https://github.com/jcsda/spack
42-
. spack/share/spack/setup-env.sh
43-
spack env create g2tmpl-env
44-
spack env activate g2tmpl-env
45-
cp $GITHUB_WORKSPACE/g2tmpl/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/g2tmpl/package.py
46-
mv $GITHUB_WORKSPACE/g2tmpl $SPACK_ENV/g2tmpl
47-
spack develop --no-clone g2tmpl@develop
48-
spack add g2tmpl@develop%gcc@11
49-
spack external find cmake gmake
50-
spack concretize
51-
# Run installation and run CTest suite
52-
spack install --verbose --fail-fast --test root
53-
# Run 'spack load' to check for obvious errors in setup_run_environment
54-
spack load g2tmpl
34+
- name: "Build Spack package"
35+
uses: NOAA-EMC/ci-test-spack-package@develop
36+
with:
37+
package-name: g2tmpl
38+
custom-recipe: spack/package.py
39+
use-repo-cache: true
40+
spack-compiler: gcc
41+
repo-cache-key-suffix: ${{ matrix.os }}-1
5542

5643
# This job validates the Spack recipe by making sure each cmake build option is represented
5744
recipe-check:
5845
runs-on: ubuntu-latest
5946

6047
steps:
61-
62-
- name: checkout-g2tmpl
63-
uses: actions/checkout@v4
64-
with:
65-
path: g2tmpl
6648

6749
- name: recipe-check
68-
run: |
69-
echo "If this jobs fails, look at the most recently output CMake option below and make sure that option appears in spack/package.py"
70-
for opt in $(grep -ioP '^option\(\K(?!(ENABLE_DOCS))[^ ]+' $GITHUB_WORKSPACE/g2tmpl/CMakeLists.txt) ; do
71-
echo "Checking for presence of '$opt' CMake option in package.py"
72-
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/g2tmpl/spack/package.py
73-
done
50+
uses: NOAA-EMC/ci-check-spack-recipe@develop
51+
with:
52+
recipe-file: package/spack/package.py
53+
cmakelists-txt: package/CMakeLists.txt
54+
ignore-list: ENABLE_DOCS

.github/workflows/developer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html
4848
4949
- name: upload-test-coverage
50-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: g2tmpl-test-coverage
5353
path: |

0 commit comments

Comments
 (0)