|
1 | | -# This workflow is designed to build PRs for AHC. Note that it does not actually publish AHC, just builds and test it. |
| 1 | +# This workflow builds and tests PRs for AHC. |
2 | 2 | # Docs: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
3 | 3 |
|
4 | 4 | name: Build PR |
|
17 | 17 | default: 'Github Actions' |
18 | 18 |
|
19 | 19 | jobs: |
20 | | - RunOnLinux: |
| 20 | + compile-and-check: |
21 | 21 | runs-on: ubuntu-latest |
22 | 22 | steps: |
23 | 23 | - uses: actions/checkout@v4 |
24 | | - - name: Grant Permission |
25 | | - run: sudo chmod +x ./mvnw |
26 | 24 | - uses: actions/setup-java@v4 |
27 | 25 | with: |
28 | 26 | distribution: 'corretto' |
29 | 27 | java-version: '11' |
30 | | - - name: Run Tests (force Docker tests) |
31 | | - run: ./mvnw -B -ntp clean test -Ddocker.tests=true |
32 | | - |
33 | | - RunOnMacOs: |
34 | | - runs-on: macos-latest |
35 | | - steps: |
36 | | - - uses: actions/checkout@v4 |
37 | 28 | - name: Grant Permission |
38 | | - run: sudo chmod +x ./mvnw |
39 | | - - uses: actions/setup-java@v4 |
40 | | - with: |
41 | | - distribution: 'corretto' |
42 | | - java-version: '11' |
43 | | - - name: Run Tests (force Docker tests) |
44 | | - run: ./mvnw -B -ntp clean test -Ddocker.tests=true |
| 29 | + run: chmod +x ./mvnw |
| 30 | + - name: Compile and API compatibility check |
| 31 | + run: ./mvnw -B -ntp clean verify -DskipTests -Dgpg.skip=true |
45 | 32 |
|
46 | | - RunOnWindows: |
47 | | - runs-on: windows-latest |
| 33 | + test: |
| 34 | + needs: compile-and-check |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 39 | + jdk: [11, 17, 21, 25] |
| 40 | + include: |
| 41 | + - jdk: 11 |
| 42 | + distribution: corretto |
| 43 | + - jdk: 17 |
| 44 | + distribution: corretto |
| 45 | + - jdk: 21 |
| 46 | + distribution: corretto |
| 47 | + - jdk: 25 |
| 48 | + distribution: corretto |
| 49 | + runs-on: ${{ matrix.os }} |
48 | 50 | steps: |
49 | 51 | - uses: actions/checkout@v4 |
50 | 52 | - uses: actions/setup-java@v4 |
51 | 53 | with: |
52 | | - distribution: 'corretto' |
53 | | - java-version: '11' |
54 | | - - name: Run Tests |
55 | | - run: ./mvnw.cmd -B -ntp clean test |
| 54 | + distribution: ${{ matrix.distribution }} |
| 55 | + java-version: ${{ matrix.jdk }} |
| 56 | + - name: Grant Permission |
| 57 | + if: runner.os != 'Windows' |
| 58 | + run: chmod +x ./mvnw |
| 59 | + - name: Run Tests (Linux) |
| 60 | + if: runner.os == 'Linux' |
| 61 | + run: ./mvnw -B -ntp clean test -Ddocker.tests=true |
| 62 | + - name: Run Tests (macOS) |
| 63 | + if: runner.os == 'macOS' |
| 64 | + run: ./mvnw -B -ntp clean test -Dno.docker.tests=true |
| 65 | + - name: Run Tests (Windows) |
| 66 | + if: runner.os == 'Windows' |
| 67 | + run: ./mvnw.cmd -B -ntp clean test -Dno.docker.tests=true |
0 commit comments