From 6e9648af2019618e16e8c4f5ce8a297bc1179872 Mon Sep 17 00:00:00 2001 From: erciccione Date: Thu, 20 Jan 2022 18:57:49 +0000 Subject: [PATCH] workflows: move coverage reports to their own action and remove from build.yml codacy's github action will allow us to run checks also on pull requests (tested on my fork) --- .github/workflows/build.yml | 5 --- .../workflows/codacy-coverage-reporter.yml | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/codacy-coverage-reporter.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d0c27f0f6..bc4d026ca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,11 +28,6 @@ jobs: run: git lfs pull - name: Build with make run: make - - name: Send coverage report to Codacy - env: - CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} - if: success() - run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r assets/build/reports/jacoco/test/jacocoTestReport.xml - name: cache nodes dependencies uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/codacy-coverage-reporter.yml b/.github/workflows/codacy-coverage-reporter.yml new file mode 100644 index 0000000000..5829d8e784 --- /dev/null +++ b/.github/workflows/codacy-coverage-reporter.yml @@ -0,0 +1,38 @@ +name: codacy-coverage-reporter + +on: ["push"] + +jobs: + codacy-coverage-reporter: + runs-on: ubuntu-latest + name: codacy-coverage-reporter + steps: + - uses: actions/checkout@v2 + with: + lfs: true + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + cache: gradle + - name: Pull lfs + run: git lfs pull + - name: Build with make + run: make + - name: cache nodes dependencies + uses: actions/upload-artifact@v2 + with: + name: cached-localnet + path: .localnet + - name: Cleanup Gradle Cache + # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. + # Restoring these files from a GitHub Actions cache might cause problems for future builds. + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties + - name: Run codacy-coverage-reporter + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: assets/build/reports/jacoco/test/jacocoTestReport.xml