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

CI updates #31

Merged
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
48 changes: 13 additions & 35 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +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 }}

- 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
make install
cmake -S pfunit -B pfunit/build -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit -DCMAKE_BUILD_TYPE=Release
cmake --build pfunit/build --parallel 2
cmake --install pfunit/build

- name: checkout
uses: actions/checkout@v4
with:
path: landsfcutil
submodules: true

- name: build
run: |
cd landsfcutil
mkdir build
cd build
${{ matrix.compilers }} cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit"
make -j2 VERBOSE=1
cmake -S landsfcutil -B landsfcutil/build -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit"
cmake --build landsfcutil/build --parallel 2 --verbose

- name: test
run: |
cd $GITHUB_WORKSPACE/landsfcutil/build
make test VERBOSE=1
run: ctest --test-dir landsfcutil/build --verbose
46 changes: 13 additions & 33 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,25 @@ jobs:
runs-on: ${{ matrix.os }}

steps:

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

- 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 landsfcutil-env
spack env activate landsfcutil-env
cp $GITHUB_WORKSPACE/landsfcutil/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/landsfcutil/package.py
spack develop --no-clone --path $GITHUB_WORKSPACE/landsfcutil landsfcutil@develop
spack add landsfcutil@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 landsfcutil
ls $LANDSFCUTIL_LIB
ls $LANDSFCUTIL_LIB4
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: landsfcutil
package-variants: +pfunit
custom-recipe: spack/package.py
spack-compiler: gcc
spack-externals: cmake gmake m4 python perl
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-landsfcutil
uses: actions/checkout@v4
with:
path: landsfcutil

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

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

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 }}-${{ hashFiles('pfunit/VERSION') }}

- 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 -S pfunit -B pfunit/build -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit
cmake --build pfunit/build --parallel 2
cmake --install pfunit/build

- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: landsfcutil
submodules: true

- name: build
run: |
cd landsfcutil
mkdir build
cd build
cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit;~/"
make -j2
cmake -S landsfcutil -B landsfcutil/build -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit;~/"
cmake --build landsfcutil/build --parallel 2 --verbose

- name: test
run: |
cd $GITHUB_WORKSPACE/landsfcutil/build
make test
run: ctest --test-dir landsfcutil/build --verbose