|
| 1 | +# This file is part of JavaSMT, |
| 2 | +# an API wrapper for a collection of SMT solvers: |
| 3 | +# https://github.com/sosy-lab/java-smt |
| 4 | +# |
| 5 | +# SPDX-FileCopyrightText: 2026 Dirk Beyer <https://www.sosy-lab.org> |
| 6 | +# |
| 7 | +# SPDX-License-Identifier: Apache-2.0 |
| 8 | + |
| 9 | +name: example-project-ci |
| 10 | + |
| 11 | +on: |
| 12 | + push |
| 13 | + |
| 14 | +jobs: |
| 15 | + ivy: |
| 16 | + name: Ivy Example Project |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + java-version: [ 21 ] |
| 21 | + os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-26-intel, macos-26] |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v6 |
| 25 | + |
| 26 | + - name: Set up JDK ${{ matrix.java-version }} |
| 27 | + uses: actions/setup-java@v5 |
| 28 | + with: |
| 29 | + java-version: ${{ matrix.java-version }} |
| 30 | + distribution: 'temurin' |
| 31 | + |
| 32 | + - name: Shared Ivy Cache |
| 33 | + uses: actions/cache@v5 |
| 34 | + with: |
| 35 | + path: .ivy2 |
| 36 | + # We use a unique key for each run to ensure the cache is updated if needed, |
| 37 | + # while restoring from the most recent "ivy-shared-" cache. |
| 38 | + key: ivy-shared-${{ github.run_id }} |
| 39 | + restore-keys: | |
| 40 | + ivy-shared- |
| 41 | + enableCrossOsArchive: true |
| 42 | + |
| 43 | + - name: Build Ivy project |
| 44 | + run: | |
| 45 | + cd doc/Example-Ivy-Project |
| 46 | + ant compile |
| 47 | +
|
| 48 | + - name: Show solver table |
| 49 | + run: | |
| 50 | + cd doc/Example-Ivy-Project |
| 51 | + ant run |
| 52 | + env: |
| 53 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 54 | + |
| 55 | + - name: Run tests |
| 56 | + run: | |
| 57 | + cd doc/Example-Ivy-Project |
| 58 | + ant test |
| 59 | + env: |
| 60 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 61 | + |
| 62 | + - name: Upload test report |
| 63 | + uses: actions/upload-artifact@v7 |
| 64 | + if: always() |
| 65 | + with: |
| 66 | + path: doc/Example-Ivy-Project/build/test-report/html/junit-noframes.html |
| 67 | + archive: false |
| 68 | + |
| 69 | + maven: |
| 70 | + name: Maven Example Project |
| 71 | + strategy: |
| 72 | + fail-fast: false |
| 73 | + matrix: |
| 74 | + java-version: [ 21 ] |
| 75 | + os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-26-intel, macos-26] |
| 76 | + runs-on: ${{ matrix.os }} |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v6 |
| 79 | + |
| 80 | + - name: Set up JDK ${{ matrix.java-version }} |
| 81 | + uses: actions/setup-java@v5 |
| 82 | + with: |
| 83 | + java-version: ${{ matrix.java-version }} |
| 84 | + distribution: 'temurin' |
| 85 | + |
| 86 | + - name: Shared Maven Cache |
| 87 | + uses: actions/cache@v5 |
| 88 | + with: |
| 89 | + path: .m2/repository |
| 90 | + # We use a unique key for each run to ensure the cache is updated if needed, |
| 91 | + # while restoring from the most recent "maven-shared-" cache. |
| 92 | + key: maven-shared-${{ github.run_id }} |
| 93 | + restore-keys: | |
| 94 | + maven-shared- |
| 95 | + enableCrossOsArchive: true |
| 96 | + |
| 97 | + - name: Build Maven example project |
| 98 | + run: | |
| 99 | + cd doc/Example-Maven-Project |
| 100 | + mvn -DskipTests compile |
| 101 | +
|
| 102 | + - name: Show solver table |
| 103 | + run: | |
| 104 | + cd doc/Example-Maven-Project |
| 105 | + mvn exec:exec |
| 106 | + env: |
| 107 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 108 | + |
| 109 | + - name: Run tests |
| 110 | + run: | |
| 111 | + cd doc/Example-Maven-Project |
| 112 | + mvn test |
| 113 | + env: |
| 114 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 115 | + |
| 116 | + - name: Generate test report |
| 117 | + run : | |
| 118 | + cd doc/Example-Maven-Project |
| 119 | + mvn surefire-report:report-only |
| 120 | +
|
| 121 | + - name: Upload test report |
| 122 | + uses: actions/upload-artifact@v7 |
| 123 | + if: always() |
| 124 | + with: |
| 125 | + path: doc/Example-Maven-Project/target/reports/surefire.html |
| 126 | + archive: false |
| 127 | + |
| 128 | + web: |
| 129 | + name: Maven Web Example Project |
| 130 | + strategy: |
| 131 | + fail-fast: false |
| 132 | + matrix: |
| 133 | + java-version: [ 21 ] |
| 134 | + os: [ubuntu-24.04] |
| 135 | + runs-on: ${{ matrix.os }} |
| 136 | + steps: |
| 137 | + - uses: actions/checkout@v6 |
| 138 | + |
| 139 | + - name: Set up JDK ${{ matrix.java-version }} |
| 140 | + uses: actions/setup-java@v5 |
| 141 | + with: |
| 142 | + java-version: ${{ matrix.java-version }} |
| 143 | + distribution: 'temurin' |
| 144 | + |
| 145 | + - name: Shared Maven Cache |
| 146 | + uses: actions/cache@v5 |
| 147 | + with: |
| 148 | + path: .m2/repository |
| 149 | + # We use a unique key for each run to ensure the cache is updated if needed, |
| 150 | + # while restoring from the most recent "maven-shared-" cache. |
| 151 | + key: maven-shared-${{ github.run_id }} |
| 152 | + restore-keys: | |
| 153 | + maven-shared- |
| 154 | + enableCrossOsArchive: true |
| 155 | + |
| 156 | + - name: Build Maven Web example project |
| 157 | + run: | |
| 158 | + cd doc/Example-Maven-Web-Project |
| 159 | + mvn -DskipTests package |
| 160 | +
|
| 161 | + - name: Run tests |
| 162 | + run: | |
| 163 | + cd doc/Example-Maven-Web-Project |
| 164 | + mvn test |
| 165 | + env: |
| 166 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 167 | + |
| 168 | + - name: Generate test report |
| 169 | + run : | |
| 170 | + cd doc/Example-Maven-Web-Project |
| 171 | + mvn surefire-report:report-only |
| 172 | +
|
| 173 | + - name: Upload test report |
| 174 | + uses: actions/upload-artifact@v7 |
| 175 | + if: always() |
| 176 | + with: |
| 177 | + path: doc/Example-Maven-Web-Project/target/reports/surefire.html |
| 178 | + archive: false |
| 179 | + |
| 180 | + gradle: |
| 181 | + name: Gradle Example Project |
| 182 | + strategy: |
| 183 | + fail-fast: false |
| 184 | + matrix: |
| 185 | + java-version: [ 21 ] |
| 186 | + os: [ ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-26-intel, macos-26 ] |
| 187 | + runs-on: ${{ matrix.os }} |
| 188 | + steps: |
| 189 | + - uses: actions/checkout@v6 |
| 190 | + |
| 191 | + - name: Set up JDK ${{ matrix.java-version }} |
| 192 | + uses: actions/setup-java@v5 |
| 193 | + with: |
| 194 | + java-version: ${{ matrix.java-version }} |
| 195 | + distribution: 'temurin' |
| 196 | + architecture: ${{ matrix.arch }} |
| 197 | + |
| 198 | + - name: Shared Maven Cache |
| 199 | + uses: actions/cache@v5 |
| 200 | + with: |
| 201 | + path: .m2/repository |
| 202 | + # We use a unique key for each run to ensure the cache is updated if needed, |
| 203 | + # while restoring from the most recent "maven-shared-" cache. |
| 204 | + key: maven-shared-${{ github.run_id }} |
| 205 | + restore-keys: | |
| 206 | + maven-shared- |
| 207 | + enableCrossOsArchive: true |
| 208 | + |
| 209 | + - name: Install Gradle |
| 210 | + uses: gradle/actions/setup-gradle@v6 |
| 211 | + with: |
| 212 | + gradle-version: '9.5.1' |
| 213 | + |
| 214 | + - name: Build Gradle example project |
| 215 | + run: | |
| 216 | + cd doc/Example-Gradle-Project |
| 217 | + gradle build -x test |
| 218 | +
|
| 219 | + - name: Show solver table |
| 220 | + run: | |
| 221 | + cd doc/Example-Gradle-Project |
| 222 | + gradle run |
| 223 | + env: |
| 224 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 225 | + |
| 226 | + - name: Run tests |
| 227 | + run: | |
| 228 | + cd doc/Example-Gradle-Project |
| 229 | + gradle test |
| 230 | + env: |
| 231 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 232 | + |
| 233 | + - name: Upload test report |
| 234 | + uses: actions/upload-artifact@v7 |
| 235 | + if: always() |
| 236 | + with: |
| 237 | + path: doc/Example-Gradle-Project/build/reports/tests/test/index.html |
| 238 | + archive: false |
| 239 | + |
| 240 | + kotlin: |
| 241 | + name: Kotlin Example Project |
| 242 | + strategy: |
| 243 | + fail-fast: false |
| 244 | + matrix: |
| 245 | + java-version: [ 21 ] |
| 246 | + os: [ ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-26-intel, macos-26 ] |
| 247 | + runs-on: ${{ matrix.os }} |
| 248 | + steps: |
| 249 | + - uses: actions/checkout@v6 |
| 250 | + |
| 251 | + - name: Set up JDK ${{ matrix.java-version }} |
| 252 | + uses: actions/setup-java@v5 |
| 253 | + with: |
| 254 | + java-version: ${{ matrix.java-version }} |
| 255 | + distribution: 'temurin' |
| 256 | + architecture: ${{ matrix.arch }} |
| 257 | + |
| 258 | + - name: Shared Maven Cache |
| 259 | + uses: actions/cache@v5 |
| 260 | + with: |
| 261 | + path: .m2/repository |
| 262 | + # We use a unique key for each run to ensure the cache is updated if needed, |
| 263 | + # while restoring from the most recent "maven-shared-" cache. |
| 264 | + key: maven-shared-${{ github.run_id }} |
| 265 | + restore-keys: | |
| 266 | + maven-shared- |
| 267 | + enableCrossOsArchive: true |
| 268 | + |
| 269 | + - name: Install Gradle |
| 270 | + uses: gradle/actions/setup-gradle@v6 |
| 271 | + with: |
| 272 | + gradle-version: '9.5.1' |
| 273 | + |
| 274 | + - name: Build Kotlin example project |
| 275 | + run: | |
| 276 | + cd doc/Example-Gradle-Project-Kotlin |
| 277 | + gradle build -x test |
| 278 | +
|
| 279 | + - name: Show solver table |
| 280 | + run: | |
| 281 | + cd doc/Example-Gradle-Project-Kotlin |
| 282 | + gradle run |
| 283 | + env: |
| 284 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 285 | + |
| 286 | + - name: Run tests |
| 287 | + run: | |
| 288 | + cd doc/Example-Gradle-Project-Kotlin |
| 289 | + gradle test |
| 290 | + env: |
| 291 | + LD_PRELOAD: /usr/lib/${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64-linux-gnu' || 'x86_64-linux-gnu' }}/libstdc++.so.6 |
| 292 | + |
| 293 | + - name: Upload test report |
| 294 | + uses: actions/upload-artifact@v7 |
| 295 | + if: always() |
| 296 | + with: |
| 297 | + path: doc/Example-Gradle-Project-Kotlin/build/reports/tests/test/index.html |
| 298 | + archive: false |
0 commit comments