Run integration tests in matrix #2
Workflow file for this run
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: Java Version Matrix Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'integration-tests/**' | |
| - 'prometheus-metrics-core/**' | |
| - 'prometheus-metrics-exporter-*/**' | |
| - 'prometheus-metrics-exposition-*/**' | |
| - '.github/workflows/java-version-matrix-tests.yml' | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| integration-tests: | |
| name: Java ${{ matrix.java-version }} | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [8, 11, 17, 21, 25] | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up mise | |
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | |
| with: | |
| version: v2026.1.4 | |
| sha256: 79c798e39b83f0dd80108eaa88c6ca63689695ae975fd6786e7a353ef9f87002 | |
| - name: Cache local Maven repository | |
| uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Build project artifacts | |
| run: mise exec -- ./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn | |
| - name: Run exporter integration tests | |
| env: | |
| TEST_JAVA_VERSION: ${{ matrix.java-version }} | |
| run: | | |
| cd integration-tests/it-exporter | |
| mise exec -- ../../mvnw verify -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn | |
| - name: Run PushGateway integration tests | |
| env: | |
| TEST_JAVA_VERSION: ${{ matrix.java-version }} | |
| run: | | |
| cd integration-tests/it-pushgateway | |
| mise exec -- ../../mvnw verify -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@ea054f6ae8c2301482d18e6b268d90fbabc8da78 # v4.6.0 | |
| with: | |
| name: test-results-java-${{ matrix.java-version }} | |
| path: | | |
| integration-tests/**/target/surefire-reports/ | |
| integration-tests/**/target/failsafe-reports/ | |
| retention-days: 7 |