Skip to content

Commit

Permalink
change codecov (JabRef#10616)
Browse files Browse the repository at this point in the history
* change codecov

* Update metrics only on main branch

* Also checkout only on main
  • Loading branch information
koppor committed Nov 4, 2023
1 parent 86870cb commit 245e75e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 245e75e

Please sign in to comment.