Skip to content
Merged
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
47 changes: 40 additions & 7 deletions .github/workflows/ngwpc-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ mpi-default-bin libopenmpi-dev libboost-all-dev libudunits2-dev libnetcdf-dev libnetcdf-c++4-dev
sudo apt-get install -y cmake g++ mpi-default-bin libopenmpi-dev libudunits2-dev libnetcdf-dev libnetcdf-c++4-dev
python3 -m pip install numpy==1.26.4 netcdf4 bmipy pandas torch pyyaml pyarrow
#python3 -m pip install -r extern/test_bmi_py/requirements.txt
#python3 -m pip install -r extern/t-route/requirements.txt
Expand All @@ -139,12 +139,47 @@ jobs:
uses: github/codeql-action/init@v4
with:
languages: cpp
# Build (replicate your CMake build commands from Dockerfile or local builds)
- name: Install Boost
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential curl ca-certificates bzip2 python3-dev

BOOST_VER=1.86.0
BOOST_UNDERSCORE=1_86_0
PREFIX=/opt/boost-${BOOST_VER}

curl -fL --retry 10 --retry-delay 2 --max-time 600 \
-o /tmp/boost.tar.bz2 \
"https://sourceforge.net/projects/boost/files/boost/${BOOST_VER}/boost_${BOOST_UNDERSCORE}.tar.bz2/download"

tar -xjf /tmp/boost.tar.bz2 -C /tmp
cd "/tmp/boost_${BOOST_UNDERSCORE}"

./bootstrap.sh --prefix="${PREFIX}"

# Build Boost libraries
./b2 -j"$(nproc)" install \
--with-system \
--with-filesystem \
--with-program_options \
--with-thread \
--with-regex \
--with-date_time \
--with-serialization
echo "BOOST_ROOT=${PREFIX}" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=${PREFIX}:${CMAKE_PREFIX_PATH:-}" >> "$GITHUB_ENV"

- name: Build C++ code
env:
PYTHONPATH: ${{ env.PYTHONPATH }}
run: |
cmake -B cmake_build -S . \
-DCMAKE_PREFIX_PATH="${BOOST_ROOT}" \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBOOST_ROOT="${BOOST_ROOT}" \
-DPYTHON_EXECUTABLE=$(which python3) \
-DNGEN_WITH_MPI=ON \
-DNGEN_WITH_NETCDF=ON \
Expand All @@ -156,9 +191,7 @@ jobs:
-DNGEN_WITH_TESTS=OFF \
-DNGEN_WITH_ROUTING=ON \
-DNGEN_QUIET=ON \
-DNGEN_UPDATE_GIT_SUBMODULES=OFF \
# Using boost from apt for simplicity and code scanning
#-DBOOST_ROOT=/opt/boost
-DNGEN_UPDATE_GIT_SUBMODULES=OFF
cmake --build cmake_build --target all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Expand Down Expand Up @@ -311,8 +344,8 @@ jobs:
--all \
"docker://${IMAGE_BASE}:${TEST_TAG}" "docker://${IMAGE_BASE}:${ALIAS_TAG}"

# tag with 'latest' on development branch push
if [ "$GITHUB_EVENT_NAME" = "push" ] && [ "$GITHUB_REF_NAME" = "development" ]; then
# tag with 'latest' on development branch
if [ "$GITHUB_REF_NAME" = "development" ]; then
skopeo copy \
--src-creds "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" \
--dest-creds "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" \
Expand Down
Loading