Skip to content

Commit

Permalink
Merge pull request #31 from AlexanderRichert-NOAA/ci_updates_may24
Browse files Browse the repository at this point in the history
CI updates
  • Loading branch information
AlexanderRichert-NOAA authored May 17, 2024
2 parents ee733bc + b98955c commit b1af8a2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 93 deletions.
51 changes: 14 additions & 37 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,49 @@ 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:

# See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html
- name: install-intel
run: |
cd /tmp
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-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: "Install Intel"
uses: NOAA-EMC/ci-install-intel-toolkit@develop
with:
compiler-setup: ${{ matrix.compilers }}

- name: checkout-pfunit
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: Goddard-Fortran-Ecosystem/pFUnit
path: pfunit

- name: cache-pfunit
id: cache-pfunit
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/pfunit
key: pfunit-${{ runner.os }}-${{ matrix.compilers }}
key: pfunit-${{ runner.os }}-${{ matrix.compilers }}-1

- name: build-pfunit
if: steps.cache-pfunit.outputs.cache-hit != 'true'
run: |
cd pfunit
mkdir build
cd build
${{ matrix.compilers }} cmake .. -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit -DCMAKE_BUILD_TYPE=Release
make -j2 VERBOSE=1
make install
cmake -B pfunit/build -S pfunit -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit -DCMAKE_BUILD_TYPE=Release
cmake --build pfunit/build --parallel 2 --verbose
cmake --install pfunit/build
- name: checkout
uses: actions/checkout@v4
with:
path: gfsio
submodules: true

- name: build
run: |
cd gfsio
mkdir build
cd build
${{ matrix.compilers }} cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit"
make -j2 VERBOSE=1
cmake -B build -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit"
cmake --build build --parallel 2 --verbose
- name: test
run: |
cd $GITHUB_WORKSPACE/gfsio/build
make test VERBOSE=1
ctest --test-dir build --verbose
47 changes: 14 additions & 33 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,25 @@ jobs:

steps:

- name: checkout-gfsio
uses: actions/checkout@v4
with:
path: gfsio

- name: spack-build-and-test
run: |
git clone -c feature.manyFiles=true https://github.com/jcsda/spack
. spack/share/spack/setup-env.sh
spack env create gfsio-env
spack env activate gfsio-env
cp $GITHUB_WORKSPACE/gfsio/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/gfsio/package.py
spack develop --no-clone --path $GITHUB_WORKSPACE/gfsio gfsio@develop
spack add gfsio@develop%gcc@11 +pfunit
spack external find cmake gmake m4 python
spack concretize
# Run installation and run pFunit testing
spack install --verbose --fail-fast --test root
# Run 'spack load' to check for obvious errors in setup_run_environment
spack load gfsio
ls $GFSIO_LIB
ls $GFSIO_LIB4
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: gfsio
package-variants: +pfunit
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
spack-externals: cmake gmake perl python
repo-cache-key-suffix: ${{ matrix.os }}-1

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

steps:

- name: checkout-gfsio
uses: actions/checkout@v4
with:
path: gfsio

- 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(?!(DUMMY_ENTRY))[^ ]+' $GITHUB_WORKSPACE/gfsio/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/gfsio/spack/package.py
done
uses: NOAA-EMC/ci-check-spack-recipe@develop
with:
recipe-file: package/spack/package.py
cmakelists-txt: package/CMakeLists.txt
36 changes: 13 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,41 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
FC: gfortran-9
CC: gcc-9
FC: gfortran
CC: gcc

steps:

- name: checkout-pfunit
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: Goddard-Fortran-Ecosystem/pFUnit
path: pfunit

- name: cache-pfunit
id: cache-pfunit
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/pfunit
key: pfunit-${{ runner.os }}-gcc
key: pfunit-${{ runner.os }}-gcc-1

- name: build-pfunit
if: steps.cache-pfunit.outputs.cache-hit != 'true'
run: |
cd pfunit
mkdir build
cd build
cmake .. -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit
make -j2
make install
cmake -B pfunit/build -S pfunit -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit
cmake --build pfunit/build --verbose
cmake --install pfunit/build
- name: checkout
uses: actions/checkout@v2
with:
path: gfsio
submodules: true
uses: actions/checkout@v4

- name: build
run: |
cd gfsio
mkdir build
cd build
cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit;~/"
make -j2
cmake -B build -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit"
cmake --build build --parallel 2 --verbose
- name: test
run: |
cd $GITHUB_WORKSPACE/gfsio/build
make test
cmake --build build --target test --verbose

0 comments on commit b1af8a2

Please sign in to comment.