From cb44b196a08cfe0530b81074340e6aa06c0ddcd7 Mon Sep 17 00:00:00 2001 From: Michael Weirauch Date: Sat, 7 Sep 2024 16:26:59 +0200 Subject: [PATCH] WIP --- .github/workflows/ci.yml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a665952..a846d9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: name: Test strategy: matrix: - java: [11] + java: [11, 17, 21] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: @@ -33,32 +33,26 @@ jobs: java-version: ${{ matrix.java }} cache: "maven" - # - name: Cache Maven packages - # uses: actions/cache@v2 - # with: - # path: ~/.m2 - # key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - # restore-keys: ${{ runner.os }}-m2 - - # - name: Cache SonarCloud packages - # uses: actions/cache@v2 - # with: - # path: ~/.sonar/cache - # key: ${{ runner.os }}-sonar - # restore-keys: ${{ runner.os }}-sonar - - name: Build with Maven run: mvn -B clean verify - name: Verify Java class file version run: 'javap -verbose target/classes/io/github/mweirauch/micrometer/jvm/extras/ProcessMemoryMetrics.class | grep "major version: ${{ env.TARGET_JAVA_CLASS_FILE_VERSION }}"' - # - name: SonarCloud analysis - # if: env.SONAR_TOKEN != null && matrix.java == env.DEFAULT_JAVA - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - # run: mvn -B jacoco:report jacoco:report-integration sonar:sonar -Dsonar.organization=mweirauch-github -Dsonar.projectKey=mweirauch_micrometer-jvm-extras -Dsonar.host.url=https://sonarcloud.io + - name: Cache SonarCloud packages + if: env.SONAR_TOKEN != null && matrix.java == 17 + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: SonarCloud analysis + if: env.SONAR_TOKEN != null && matrix.java == 17 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B jacoco:report jacoco:report-integration sonar:sonar -Dsonar.organization=mweirauch-github -Dsonar.projectKey=mweirauch_micrometer-jvm-extras -Dsonar.host.url=https://sonarcloud.io # - name: Publish snapshot # if: env.OSSRH_USERNAME != null && matrix.os == 'ubuntu-latest' && matrix.java == env.DEFAULT_JAVA && github.ref == 'refs/heads/main'