Establish Sonar new-code baseline for 1.2 (#71) #167
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| offline-gate: | |
| name: Offline gate (Windows, JDK 21) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up JDK | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: maven | |
| - name: Prime the exact Maven test runtime | |
| run: mvn -B -ntp "-Dtest=quality.SmokeMethodTestHarnessTest" test --file pom.xml | |
| - name: Run the strict offline test gate | |
| shell: pwsh | |
| run: .\scripts\run-offline-gate.ps1 -Goal test -StrictDependencies | |
| category-tests: | |
| name: Test (${{ matrix.category }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - category: smoke | |
| groups: smoke | |
| - category: integration | |
| groups: integration | |
| - category: property | |
| groups: property | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up JDK | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: maven | |
| - name: Run categorized tests | |
| run: mvn -B test --file pom.xml -Dgroups='${{ matrix.groups }}' | |
| verify: | |
| name: Maven Verify (JDK ${{ matrix.java }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ '17', '21' ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up JDK | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| cache: maven | |
| - name: Build and test | |
| run: mvn -B verify --file pom.xml | |
| - name: Upload Surefire reports | |
| if: matrix.java == '21' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: surefire-reports-${{ matrix.java }} | |
| path: target/surefire-reports | |
| - name: Upload JaCoCo report | |
| if: matrix.java == '21' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: jacoco-report-${{ matrix.java }} | |
| path: target/site/jacoco | |
| if-no-files-found: warn | |
| - name: Upload coverage to Codecov | |
| if: matrix.java == '21' | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| files: target/site/jacoco/jacoco.xml | |
| use_oidc: true | |
| fail_ci_if_error: true | |
| verbose: true |