|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +env: |
| 8 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 9 | + BUILD_TYPE: Release |
| 10 | + GTEST_REF: b85864c64758dec007208e56af933fc3f52044ee |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-on-ubuntu: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Setup cmake |
| 18 | + uses: jwlawson/actions-setup-cmake@v2 |
| 19 | + with: |
| 20 | + cmake-version: '3.24.x' |
| 21 | + - name: Test cmake version |
| 22 | + run: cmake --version |
| 23 | + |
| 24 | + - name: Set relative paths |
| 25 | + run: | |
| 26 | + GTEST=$GITHUB_WORKSPACE/googletest |
| 27 | + echo "GTEST=$GTEST" >> $GITHUB_ENV |
| 28 | + SSCDIR=$GITHUB_WORKSPACE/ssc |
| 29 | + echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV |
| 30 | + |
| 31 | + - name: Get cached GTest |
| 32 | + uses: actions/cache@v4 |
| 33 | + id: cachedgtest |
| 34 | + with: |
| 35 | + path: ${{env.GTEST}}/ |
| 36 | + key: gtest-ubuntu |
| 37 | + |
| 38 | + - name: Clone Gtest |
| 39 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + repository: google/googletest |
| 43 | + path: googletest |
| 44 | + ref: ${{env.GTEST_REF}} |
| 45 | + |
| 46 | + - name: build Gtest |
| 47 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 48 | + run: | |
| 49 | + export |
| 50 | + mkdir ${GTEST}/build |
| 51 | + cd ${GTEST}/build |
| 52 | + cmake -DCMAKE_CXX_FLAGS=-std=c++11 .. |
| 53 | + make |
| 54 | + |
| 55 | + - name: Checkout SSC |
| 56 | + uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + path: ssc |
| 59 | + |
| 60 | + - name: Configure CMake |
| 61 | + # Configure cmake to build ssc tests but not tools |
| 62 | + run: | |
| 63 | + mkdir ${SSCDIR}/build |
| 64 | + cd ${SSCDIR}/build |
| 65 | + cmake .. -DCMAKE_BUILD_TYPE=Release -DSAM_SKIP_TOOLS=1 |
| 66 | +
|
| 67 | + - name: Build |
| 68 | + # Build your program with the given configuration |
| 69 | + run: | |
| 70 | + cd ${SSCDIR}/build |
| 71 | + make -j4 |
| 72 | +
|
| 73 | + - name: Test |
| 74 | + # Turn off fast fail for when the landbosse tests write to cerr |
| 75 | + shell: bash |
| 76 | + run: | |
| 77 | + set -e |
| 78 | + ${SSCDIR}/build/test/Test > ${SSCDIR}/build/test/gtest.log |
| 79 | + pip install pandas requests |
| 80 | + python ${SSCDIR}/test/compare_elapsed_time.py gtest_log ${SSCDIR}/build/test/gtest.log |
| 81 | + |
| 82 | + - name: Upload Test Times CSV |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: SSC Linux Test Time Elapsed |
| 86 | + path: | |
| 87 | + ${{env.SSCDIR}}/build/test/gtest_elapsed_times.csv |
| 88 | +
|
| 89 | + - name: Upload Shared Libraries |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: SSC Linux Shared Libraries |
| 93 | + path: | |
| 94 | + ${{env.SSCDIR}}/build/ssc/libssc.so |
| 95 | + ${{env.SSCDIR}}/build/ssc/ssc.so |
| 96 | + |
| 97 | + build-on-mac: |
| 98 | + runs-on: ${{ matrix.os }} |
| 99 | + strategy: |
| 100 | + matrix: |
| 101 | + os: [macos-14-large, macos-latest] |
| 102 | + |
| 103 | + steps: |
| 104 | + - name: Setup cmake |
| 105 | + uses: jwlawson/actions-setup-cmake@v2 |
| 106 | + with: |
| 107 | + cmake-version: '3.24.x' |
| 108 | + - name: Test cmake version |
| 109 | + run: cmake --version |
| 110 | + |
| 111 | + - name: Set relative paths |
| 112 | + run: | |
| 113 | + GTEST=$GITHUB_WORKSPACE/googletest |
| 114 | + echo "GTEST=$GTEST" >> $GITHUB_ENV |
| 115 | + SSCDIR=$GITHUB_WORKSPACE/ssc |
| 116 | + echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV |
| 117 | + |
| 118 | + - name: Get cached GTest |
| 119 | + uses: actions/cache@v4 |
| 120 | + id: cachedgtest |
| 121 | + with: |
| 122 | + path: ${{env.GTEST}}/ |
| 123 | + key: gtest-${{ matrix.os }} |
| 124 | + - name: Clone Gtest |
| 125 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 126 | + uses: actions/checkout@v4 |
| 127 | + with: |
| 128 | + repository: google/googletest |
| 129 | + path: googletest |
| 130 | + ref: ${{env.GTEST_REF}} |
| 131 | + |
| 132 | + - name: build Gtest |
| 133 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 134 | + run: | |
| 135 | + export |
| 136 | + mkdir ${GTEST}/build |
| 137 | + cd ${GTEST}/build |
| 138 | + cmake -DCMAKE_CXX_FLAGS=-std=c++11 .. |
| 139 | + make |
| 140 | + |
| 141 | + - name: Checkout SSC |
| 142 | + uses: actions/checkout@v4 |
| 143 | + with: |
| 144 | + path: ssc |
| 145 | + |
| 146 | + - name: Configure CMake |
| 147 | + # Configure cmake to build ssc tests but not tools |
| 148 | + run: | |
| 149 | + mkdir ${SSCDIR}/build |
| 150 | + cd ${SSCDIR}/build |
| 151 | + cmake .. -DCMAKE_BUILD_TYPE=Release -DSAM_SKIP_TOOLS=1 -DSAMAPI_EXPORT=0 |
| 152 | +
|
| 153 | + - name: Build |
| 154 | + # Build your program with the given configuration |
| 155 | + run: | |
| 156 | + cd ${SSCDIR}/build |
| 157 | + make -j3 |
| 158 | +
|
| 159 | + - name: Test |
| 160 | + # Turn off fast fail for when the landbosse tests write to cerr |
| 161 | + run: | |
| 162 | + set -e |
| 163 | + ${SSCDIR}/build/test/Test > ${SSCDIR}/build/test/gtest.log |
| 164 | + pip install pandas requests |
| 165 | + python ${SSCDIR}/test/compare_elapsed_time.py gtest_log ${SSCDIR}/build/test/gtest.log |
| 166 | + shell: bash |
| 167 | + |
| 168 | + - name: Upload Test Times CSV |
| 169 | + if: ${{ matrix.os == 'macos-latest' }} |
| 170 | + uses: actions/upload-artifact@v4 |
| 171 | + with: |
| 172 | + name: SSC Mac Arm Test Time Elapsed |
| 173 | + path: | |
| 174 | + ${{env.SSCDIR}}/build/test/gtest_elapsed_times.csv |
| 175 | +
|
| 176 | + - name: Upload Test Times CSV |
| 177 | + if: ${{ matrix.os != 'macos-latest' }} |
| 178 | + uses: actions/upload-artifact@v4 |
| 179 | + with: |
| 180 | + name: SSC Mac Intel Test Time Elapsed |
| 181 | + path: | |
| 182 | + ${{env.SSCDIR}}/build/test/gtest_elapsed_times.csv |
| 183 | +
|
| 184 | + - name: Upload Shared Libraries |
| 185 | + if: ${{ matrix.os == 'macos-latest' }} |
| 186 | + uses: actions/upload-artifact@v4 |
| 187 | + with: |
| 188 | + name: SSC Mac Arm Shared Libraries |
| 189 | + path: | |
| 190 | + ${{env.SSCDIR}}/build/ssc/libssc.dylib |
| 191 | + ${{env.SSCDIR}}/build/ssc/ssc.dylib |
| 192 | +
|
| 193 | + - name: Upload Shared Libraries |
| 194 | + if: ${{ matrix.os != 'macos-latest' }} |
| 195 | + uses: actions/upload-artifact@v4 |
| 196 | + with: |
| 197 | + name: SSC Mac Intel Shared Libraries |
| 198 | + path: | |
| 199 | + ${{env.SSCDIR}}/build/ssc/libssc.dylib |
| 200 | + ${{env.SSCDIR}}/build/ssc/ssc.dylib |
| 201 | +
|
| 202 | + build-on-windows: |
| 203 | + runs-on: windows-2019 |
| 204 | + |
| 205 | + steps: |
| 206 | + - name: Setup cmake |
| 207 | + uses: jwlawson/actions-setup-cmake@v2 |
| 208 | + with: |
| 209 | + cmake-version: '3.24.x' |
| 210 | + - name: Test cmake version |
| 211 | + run: cmake --version |
| 212 | + |
| 213 | + - name: Set relative paths |
| 214 | + shell: bash |
| 215 | + run: | |
| 216 | + GTEST=$GITHUB_WORKSPACE/googletest |
| 217 | + echo "GTEST=$GTEST" >> $GITHUB_ENV |
| 218 | + SSCDIR=$GITHUB_WORKSPACE/ssc |
| 219 | + echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV |
| 220 | + |
| 221 | + - name: Get cached GTest |
| 222 | + uses: actions/cache@v4 |
| 223 | + id: cachedgtest |
| 224 | + with: |
| 225 | + path: ${{env.GTEST}}/ |
| 226 | + key: gtest-windows |
| 227 | + |
| 228 | + - name: Clone Gtest |
| 229 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 230 | + uses: actions/checkout@v4 |
| 231 | + with: |
| 232 | + repository: google/googletest |
| 233 | + path: googletest |
| 234 | + ref: ${{env.GTEST_REF}} |
| 235 | + |
| 236 | + - name: build Gtest |
| 237 | + if: steps.cachedgtest.outputs.cache-hit != 'true' |
| 238 | + shell: bash |
| 239 | + run: | |
| 240 | + export |
| 241 | + mkdir ${GTEST}/build |
| 242 | + cd ${GTEST}/build |
| 243 | + cmake -Dgtest_force_shared_crt=ON .. |
| 244 | + cmake --build . --config Release -j4 |
| 245 | + |
| 246 | + - name: Checkout SSC |
| 247 | + uses: actions/checkout@v4 |
| 248 | + with: |
| 249 | + path: ssc |
| 250 | + |
| 251 | + - name: Configure CMake |
| 252 | + shell: bash |
| 253 | + # Configure cmake to build ssc tests but not tools |
| 254 | + run: | |
| 255 | + mkdir ${SSCDIR}/build |
| 256 | + cd ${SSCDIR}/build |
| 257 | + cmake .. -DSAM_SKIP_TOOLS=1 -DCMAKE_CONFIGURATION_TYPES="Release" |
| 258 | + cmake --build . --config Release -j4 |
| 259 | + cp ssc/Release/* test/Release |
| 260 | +
|
| 261 | + - name: Test |
| 262 | + shell: bash |
| 263 | + # Turn off fast fail for when the landbosse tests write to cerr |
| 264 | + run: | |
| 265 | + cd ${SSCDIR}/build/test/Release |
| 266 | + ./Test.exe > ${SSCDIR}/build/test/gtest.log |
| 267 | + pip install pandas requests |
| 268 | + python ${SSCDIR}/test/compare_elapsed_time.py gtest_log ${SSCDIR}/build/test/gtest.log |
| 269 | + |
| 270 | + - name: Upload Artifacts |
| 271 | + uses: actions/upload-artifact@v4 |
| 272 | + with: |
| 273 | + name: SSC Windows Test Time Elapsed |
| 274 | + path: | |
| 275 | + ${{env.SSCDIR}}\build\test\gtest_elapsed_times.csv |
| 276 | +
|
| 277 | + - name: Upload Artifacts |
| 278 | + uses: actions/upload-artifact@v4 |
| 279 | + with: |
| 280 | + name: SSC Windows Shared Libraries |
| 281 | + path: | |
| 282 | + ${{env.SSCDIR}}\build\ssc\Release\ssc.dll |
0 commit comments