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 name: Build
on: [push, pull_request] on: [push, pull_request]
env:
COVERAGE_REPORT_PATH: "target/site/jacoco/jacoco.xml"
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -16,8 +13,19 @@ jobs:
distribution: 'adopt' distribution: 'adopt'
- name: Build with Maven - name: Build with Maven
run: mvn --batch-mode --update-snapshots verify run: mvn --batch-mode --update-snapshots verify
- name: Upload coverage to codecov - name: Upload coverage to codecov (tokenless)
uses: codecov/codecov-action@v3 if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
uses: codecov/codecov-action@v4
with: 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 fail_ci_if_error: true