Skip to content

Commit

Permalink
Merge pull request #73 from USEPA/triplet_build
Browse files Browse the repository at this point in the history
Set CXX standard for WNTR compatibility; update GH Checkout and artifact upload versions
  • Loading branch information
cbuahin authored Feb 12, 2025
2 parents 8cf3451 + 1e2fc3d commit 767acfe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: Build and Test EPANET 2.2
on:
push:
branches: [ master, triplet_build ]
branches: [ master ]
pull_request:
branches: [ master ]

Expand All @@ -18,9 +18,11 @@ jobs:
- os: windows-latest
cmake_generator: -G "Visual Studio 17 2022" -A "x64"
continue-on-error: false
alias: win64
- os: ubuntu-latest
cmake_generator: -G "Unix Makefiles"
continue-on-error: false
alias: linux
- os: macos-13
cmake_generator: -G "Xcode"
continue-on-error: false
Expand All @@ -34,29 +36,29 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
cd SRC_engines
cmake -B build ${{ matrix.cmake_generator }} .
cmake --build build --config Release --target package
cmake -B build-${{ matrix.alias }} ${{ matrix.cmake_generator }} .
cmake --build build-${{ matrix.alias }} --config Release --target package
- name: Qualify darwin artifacts with os versions
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
cd SRC_engines/build
cd SRC_engines/build-${{ matrix.alias }}
for file in *.zip; do mv "$file" "${file%.zip}-${{ matrix.alias }}.zip"; done
for file in *.tar.gz; do mv "$file" "${file%.tar.gz}-${{ matrix.alias }}.tar.gz"; done
cd ../..
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-test-artifacts
name: 'build-artifacts-${{ matrix.alias }}'
path: |
SRC_engines/build/*.zip
SRC_engines/build/*.tar.gz
SRC_engines/build-${{ matrix.alias }}/*.zip
SRC_engines/build-${{ matrix.alias }}/*.tar.gz
5 changes: 5 additions & 0 deletions SRC_engines/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ project(
"EPANET"
VERSION 2.2.0
DESCRIPTION "The EPANET Program for Water Distribution System Analysis"
LANGUAGES C CXX
)

# Set the C++ standard to C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Append local dir to module search path
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down

0 comments on commit 767acfe

Please sign in to comment.