Skip to content

Commit

Permalink
CI updates (#45)
Browse files Browse the repository at this point in the history
* update developer.yml (versions etc.)

* update Intel.yml

* update MacOS.yml

* update Spack.yml

* fix Intel.yml (re-add netcdf)
  • Loading branch information
AlexanderRichert-NOAA authored Jul 2, 2024
1 parent f47e8c0 commit 8ca4135
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 103 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,29 @@ on:
branches:
- develop

# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh
# without having to do it in manually every step
defaults:
run:
shell: bash -leo pipefail {0}

jobs:
Intel:
runs-on: ubuntu-latest
strategy:
matrix:
compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"]
compilers: ["oneapi", "classic"]

steps:

- name: "Install Intel"
uses: NOAA-EMC/ci-install-intel-toolkit@develop
with:
compiler-setup: ${{ matrix.compilers }}

- name: "Install NetCDF"
run: sudo apt-get install libnetcdf-dev libnetcdff-dev

- name: checkout-wrf_io
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: wrf_io

# See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html
- name: install-dependencies
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
sudo apt-get install libnetcdf-dev libnetcdff-dev
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: build_wrf_io
run: |
cd wrf_io
mkdir build
cd build
cmake ..
make VERBOSE=1
cmake -S wrf_io -B wrf_io/build
cmake --build wrf_io/build --verbose
14 changes: 5 additions & 9 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
Linux:
runs-on: ubuntu-latest
env:
FC: gfortran-9
CC: gcc-9
FC: gfortran-11
CC: gcc-11
steps:

- name: checkout-wrf_io
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: wrf_io

Expand All @@ -26,10 +26,6 @@ jobs:
- name: build_wrf_io
run: |
set -x
cd wrf_io
mkdir build
cd build
cmake ..
make VERBOSE=1
cmake -S wrf_io -B wrf_io/build
cmake --build wrf_io/build --verbose
13 changes: 5 additions & 8 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: macos-latest
env:
FC: gfortran-12
CC: gcc
CC: gcc-12

steps:

- name: checkout-wrf_io
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: wrf_io

Expand All @@ -30,9 +30,6 @@ jobs:
- name: build_wrf_io
run: |
set -x
cd wrf_io
mkdir build
cd build
cmake ..
make VERBOSE=1
cmake -S wrf_io -B wrf_io/build
cmake --build wrf_io/build --verbose
64 changes: 14 additions & 50 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,26 @@ jobs:

steps:

- name: checkout-wrf-io
uses: actions/checkout@v4
with:
path: wrf-io

- name: cache-spack
id: cache-spack
uses: actions/cache@v3
with:
path: ~/spack-build-cache
key: spack-build-cache-${{ matrix.os }}-1

- name: spack-build-and-test
run: |
cd
git clone -c feature.manyFiles=true https://github.com/jcsda/spack
. spack/share/spack/setup-env.sh
spack env create wrf-io-env
spack env activate wrf-io-env
cp $GITHUB_WORKSPACE/wrf-io/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/wrf-io/package.py
spack develop --no-clone --path $GITHUB_WORKSPACE/wrf-io wrf-io@develop
spack add wrf-io@develop%gcc@11 ^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi
spack external find cmake gmake openmpi
spack config add "packages:openmpi:buildable:false"
for mirror in $(spack mirror list | awk '{print $1}'); do
spack mirror rm --scope defaults ${mirror}
done
spack mirror add spack-build-cache ~/spack-build-cache
spack concretize
# Run installation and run CTest suite
if [ "${{ steps.cache.outputs.cache-hit }}" == true ]; then deps=only; else deps=auto; fi
spack install --verbose --fail-fast --no-check-signature --use-buildcache package:never,dependencies:${deps} --test root
spack buildcache push --only dependencies --unsigned --allow-root ~/spack-build-cache wrf-io
- name: Upload test results
uses: actions/upload-artifact@v3
if: ${{ failure() }}
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
name: spackci-ctest-output-${{ matrix.os }}-${{ matrix.openmp }}
path: ${{ github.workspace }}/wrf-io/spack-build-*/Testing/Temporary/LastTest.log
package-name: wrf-io
package-variants: "^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi"
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
repo-cache-key-suffix: ${{ matrix.os }}-1
spack-externals: cmake gmake perl openmpi

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

steps:

- name: checkout-wrf-io
uses: actions/checkout@v4
with:
path: wrf-io

- name: recipe-check
run: |
echo "If this jobs fails, look at the most recently output CMake option below and make sure that option appears in spack/package.py"
for opt in $(grep -ioP '^option\(\K(?!(ENABLE_DOCS))[^ ]+' $GITHUB_WORKSPACE/wrf-io/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/wrf-io/spack/package.py
done
uses: NOAA-EMC/ci-check-spack-recipe@develop
with:
recipe-file: package/spack/package.py
cmakelists-txt: package/CMakeLists.txt
ignore-list: ENABLE_DOCS
16 changes: 5 additions & 11 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
developer:
runs-on: ubuntu-latest
env:
FC: gfortran-9
CC: gcc-9
FC: gfortran-11
CC: gcc-11

steps:

- name: checkout-wrf_io
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: wrf_io

Expand All @@ -28,11 +28,5 @@ jobs:
- name: build_wrf_io
run: |
set -x
cd wrf_io
mkdir build
cd build
cmake -DENABLE_DOCS=On -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fsanitize=address" ..
make VERBOSE=1
cmake -S wrf_io -B wrf_io/build -DENABLE_DOCS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fsanitize=address" ..
cmake --build wrf_io/build --verbose

0 comments on commit 8ca4135

Please sign in to comment.