Update codecov/codecov-action to v4 (#5100)

This commit is contained in:
Piotr Idzik
2024-04-06 20:50:15 +02:00
committed by GitHub
parent ab094ef04d
commit 295ac4b1ac

View File

@ -1,9 +1,6 @@
name: Build
on: [push, pull_request]
env:
COVERAGE_REPORT_PATH: "target/site/jacoco/jacoco.xml"
jobs:
build:
runs-on: ubuntu-latest
@ -16,8 +13,19 @@ jobs:
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
- name: Upload coverage to codecov (tokenless)
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
uses: codecov/codecov-action@v4
with:
files: "${{ env.REPORT_NAME }}"
fail_ci_if_error: true
- name: Upload coverage to codecov (with token)
if: >
github.repository == 'TheAlgorithms/Java' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true