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 #150

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
44 changes: 12 additions & 32 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,31 @@ 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: checkout-bacio
uses: actions/checkout@v2
- name: "Install Intel"
uses: NOAA-EMC/ci-install-intel-toolkit@develop
with:
repository: NOAA-EMC/NCEPLIBS-bacio
path: bacio
compiler-setup: ${{ matrix.compilers }}

- name: "Checkout bacio"
uses: actions/checkout@v4

- name: build
- name: "Build bacio"
run: |
cd bacio
mkdir build
cd build
${{ matrix.compilers }} cmake ..
make -j2 VERBOSE=1
cmake -B build
cmake --build build --parallel 2 --verbose

- name: test
- name: "Test bacio"
run: |
set -e
cd $GITHUB_WORKSPACE/bacio/build
ctest --verbose --output-on-failure --rerun-failed
ctest --test-dir build --verbose --output-on-failure --rerun-failed


14 changes: 4 additions & 10 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@ jobs:
steps:

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

- name: build
run: |
cd bacio
mkdir build
cd build
cmake ..
make -j2 VERBOSE=1
cmake -B build
cmake --build build --parallel 2 --verbose

- name: test
run: |
set -e
cd $GITHUB_WORKSPACE/bacio/build
ctest --output-on-failure --rerun-failed --verbose
ctest --test-dir build --output-on-failure --rerun-failed --verbose


16 changes: 5 additions & 11 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,19 @@ jobs:
steps:

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

- name: build
run: |
cd bacio
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DCMAKE_INSTALL_PREFIX=~/install ..
make -j2 VERBOSE=1
make install
cmake -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DCMAKE_INSTALL_PREFIX=~/install
cmake --build build --parallel 2 --verbose
cmake --install build
ls -l ~/install
ls -l ~/install/lib

- name: test
run: |
set -e
cd $GITHUB_WORKSPACE/bacio/build
ctest --verbose --output-on-failure --rerun-failed
ctest --test-dir build --verbose --output-on-failure --rerun-failed


49 changes: 15 additions & 34 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,30 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
sharedlibs: ["+shared", "~shared"]
pic: ["+pic", "~pic"]
variants: ["+shared+pic", "~shared~pic"]
runs-on: ${{ matrix.os }}

steps:

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

- name: spack-build-and-test
run: |
git clone -c feature.manyFiles=true https://github.com/spack/spack
. spack/share/spack/setup-env.sh
spack env create bacio-env
spack env activate bacio-env
cp $GITHUB_WORKSPACE/bacio/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/bacio/package.py
mv $GITHUB_WORKSPACE/bacio $SPACK_ENV/bacio
spack develop --no-clone bacio@develop
spack add bacio@develop%gcc@11 ${{ matrix.sharedlibs }} ${{ matrix.pic }}
spack external find cmake gmake
spack concretize
# Run installation and run CTest suite
spack install --verbose --fail-fast --test root
# Run 'spack load' to check for obvious errors in setup_run_environment
spack load bacio
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: bacio
package-variants: ${{ matrix.variants }}
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
repo-cache-key-suffix: ${{ matrix.os }}-${{ matrix.variants }}-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-bacio
uses: actions/checkout@v4
with:
path: bacio

- 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/bacio/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/bacio/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
6 changes: 3 additions & 3 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python3 -m pip install gcovr

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

Expand All @@ -49,14 +49,14 @@ jobs:
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null

- name: upload-test-coverage
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: bacio-test-coverage
path: |
bacio/build/*.html
bacio/build/*.css

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: docs
path: |
Expand Down