Run integration tests in matrix #1
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: Integration Tests (Java ${{ matrix.java-version }}) | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [8, 11, 17, 21, 25] | |
| test-module: | |
| - it-exporter | |
| - it-pushgateway | |
| 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 integration tests for ${{ matrix.test-module }} | |
| env: | |
| TEST_JAVA_VERSION: ${{ matrix.java-version }} | |
| run: | | |
| cd integration-tests/${{ matrix.test-module }} | |
| mise exec -- ../../mvnw verify -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn | |
| summary: | |
| name: Matrix Test Summary | |
| runs-on: ubuntu-24.04 | |
| needs: integration-tests | |
| if: always() | |
| steps: | |
| - name: Check matrix results | |
| run: | | |
| if [ "${{ needs.integration-tests.result }}" == "failure" ]; then | |
| echo "::error::One or more Java version matrix tests failed" | |
| exit 1 | |
| fi |