-
Notifications
You must be signed in to change notification settings - Fork 58
62 lines (57 loc) · 2.21 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build and Test EPANET 2.2
on:
push:
branches: [ master, triplet_build ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build, Unit Testing, and Regression Testing
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-13, macos-14]
include:
- os: windows-latest
cmake_generator: -G "Visual Studio 17 2022" -A "x64"
continue-on-error: false
- os: ubuntu-latest
cmake_generator: -G "Unix Makefiles"
continue-on-error: false
- os: macos-13
cmake_generator: -G "Xcode"
continue-on-error: false
alias: intel-mac
- os: macos-14
cmake_generator: -G "Xcode"
continue-on-error: false
alias: apple-silicon
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.continue-on-error }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- 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
- name: Qualify darwin artifacts with os versions
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
cd SRC_engines/build
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
with:
name: build-test-artifacts
path: |
SRC_engines/build/*.zip
SRC_engines/build/*.tar.gz