forked from USEPA/Stormwater-Management-Model
-
Notifications
You must be signed in to change notification settings - Fork 76
158 lines (141 loc) · 5.06 KB
/
build-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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# build-and-test.yml - GitHub Actions CI for swmm-solver
#
# Created: May 19, 2020
# Updated: Jun 22, 2021
#
# Author: Michael E. Tryby
# US EPA - ORD/CESER
#
# Caleb A. Buahin
# Xylem Inc.
#
name: Build and Test
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-20.04, macos-12]
requirements: [requirements-swmm.txt]
include:
- os: windows-2022
sys_pkgs: choco install boost-msvc-14.3
boost_platform_version: 2022
boost_toolsit: mvc
build_unit_test: make.cmd /g "Visual Studio 17 2022" /A "x64" /t
build_reg_test: make.cmd /g "Visual Studio 17 2022" /A "x64"
before_reg_test: before-nrtest.cmd
run_reg_test: run-nrtests.cmd
build_id: "%GITHUB_RUN_ID%_%GITHUB_RUN_NUMBER%"
experimental: false
artifacts_ext: zip
artifact_content_type: zip
defaults:
run:
shell: cmd
working-directory: ./ci-tools/windows
- os: ubuntu-20.04
sys_pkgs: sudo apt install libboost-dev libboost-all-dev
boost_platform_version: 20.04
boost_toolsit: gcc
# Statically link libraries with -s switch to address GitHub Ubuntu 20.04 symbol errors (issue #340)
build_unit_test: make.sh -s -t -g "Unix Makefiles"
build_reg_test: make.sh -s -g "Unix Makefiles"
before_reg_test: before-nrtest.sh
run_reg_test: run-nrtests.sh
build_id: ${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
experimental: true
artifacts_ext: tar.gz
artifact_content_type: tar
defaults:
run:
shell: bash
working-directory: ./ci-tools/linux
- os: macos-12
sys_pkgs: brew install libomp #boost
boost_platform_version: 12
boost_toolsit: clang
build_unit_test: make.zsh -t -g "Xcode"
build_reg_test: make.zsh -g "Xcode"
before_reg_test: before-nrtest.zsh
run_reg_test: run-nrtests.zsh
build_id: ${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
experimental: true
artifacts_ext: tar.gz
artifact_content_type: tar
defaults:
run:
shell: zsh {0}
working-directory: ./ci-tools/darwin
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
defaults:
run:
shell: ${{ matrix.defaults.run.shell }}
working-directory: ${{ matrix.defaults.run.working-directory }}
env:
OMP_NUM_THREADS: 1
PROJECT: swmm
BUILD_HOME: build
TEST_HOME: nrtests
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Clone ci-tools repo
uses: actions/checkout@v3
with:
repository: pyswmm/ci-tools
ref: master
path: ci-tools
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-swmm.txt
# install boost on mac and linux
- name: Install required system packages on mac and linux
run: ${{ matrix.sys_pkgs }}
if: ${{ runner.os == 'macOS' }}
# boost takes a while to install on windows, so try to cache
- name: Install boost
# if: ${{runner.os == 'Windows'}}
uses: MarkusJx/install-boost@v2.4.4
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.81.0
link: shared
# OPTIONAL: Specify a custon install location
# boost_install_dir: C:\some_directory
# OPTIONAL: Specify a platform version
platform_version: ${{ matrix.boost_platform_version }}
# OPTIONAL: Specify a toolset
toolset: ${{ matrix.boost_toolset }}
- name: Build and unit test
env:
BOOST_ROOT_1_81_0: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: ./${{ matrix.build_unit_test }}
- name: Build for reg test
env:
BOOST_ROOT_1_81_0: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: ./${{ matrix.build_reg_test }}
- name: Before reg test
env:
NRTESTS_URL: https://github.com/pyswmm/swmm-nrtestsuite
BENCHMARK_TAG: v3.1.0
run: ./${{ matrix.before_reg_test }} ${{ env.BENCHMARK_TAG }}
- name: Run reg test
run: ./${{ matrix.run_reg_test }} ${{ matrix.build_id }}
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: build-test-artifacts
path: upload/*.*