From 4afb8ab50f5bb285d88d8370d7e8e87815e73069 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 1 Feb 2023 00:28:48 -0800 Subject: [PATCH 1/3] Updated workflow to latest actions --- .github/workflows/gradle.yml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e74b032..5b579c2 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,6 +1,6 @@ name: gradle-ci -on: [push, pull_request, workflow_dispatch] +on: [ push, pull_request, workflow_dispatch ] jobs: build-gradle-project: @@ -11,17 +11,17 @@ jobs: SONAR_JDK: "11" strategy: - matrix: - java-version: [ 11, 17, 19 ] + matrix: + java-version: [ 11, 17, 19 ] steps: - name: Checkout source repository - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: ${{ matrix.java-version }} @@ -31,24 +31,16 @@ jobs: - name: Cache SonarCloud packages if: matrix.java-version == env.SONAR_JDK - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle-${{ matrix.java-version }}- - +w - name: Test with Gradle - run: ./gradlew build check --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }} + uses: gradle/gradle-build-action@v2 + with: + arguments: build check --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }} - name: SonarCloud if: success() && matrix.java-version == env.SONAR_JDK @@ -56,8 +48,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: ./gradlew jacocoTestReport sonar --info - - - name: Cleanup Gradle Cache - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties \ No newline at end of file From 3f3447a48b4059bd74b0391e5d37ac71a675f9d6 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 1 Feb 2023 00:31:21 -0800 Subject: [PATCH 2/3] Fixed dangling typo --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5b579c2..c8e45bd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -36,7 +36,7 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar -w + - name: Test with Gradle uses: gradle/gradle-build-action@v2 with: From 626e20d0303809d95c8b049d7558c492bb8c4e3c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 1 Feb 2023 00:40:04 -0800 Subject: [PATCH 3/3] Fixed incorrect yaml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c8e45bd..245463a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout source repository - - uses: actions/checkout@v3 + uses: actions/checkout@v3 with: fetch-depth: 0