From 245e75ec5e5c5ce5e39c02b6e0abfa84dafca481 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sat, 4 Nov 2023 17:38:43 +0100 Subject: [PATCH] change codecov (#10616) * change codecov * Update metrics only on main branch * Also checkout only on main --- .github/workflows/tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03914a7cbb1..e1be0f8c869 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -304,6 +304,7 @@ jobs: steps: - name: Check secrets presence id: checksecrets + if: github.ref == 'refs/heads/main' shell: bash run: | if [ "$CODECOV_TOKEN" == "" ]; then @@ -312,25 +313,31 @@ jobs: echo "secretspresent=YES" >> $GITHUB_OUTPUT fi env: - SNAPCRAFT_LOGIN_FILE: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Checkout source + if: github.ref == 'refs/heads/main' uses: actions/checkout@v4 with: submodules: 'true' show-progress: 'false' - name: Set up JDK + if: github.ref == 'refs/heads/main' uses: actions/setup-java@v3 with: java-version: 21.0.1 distribution: 'liberica' cache: 'gradle' - name: Update test coverage metrics - if: steps.checksecrets.outputs.secretspresent == 'YES' - run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash); + if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES') + run: xvfb-run --auto-servernum ./gradlew jacocoTestReport env: CI: "true" CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} DBMS: "postgresql" + - uses: codecov/codecov-action@v3 + if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES') + with: + token: ${{ secrets.CODECOV_TOKEN }} # This is https://github.com/marketplace/actions/gradle-wrapper-validation # It ensures that the jar file is from gradle and not by a strange third party. gradlevalidation: