Skip to content

Commit

Permalink
[#163] Run upload to Codecov step only if the token was provided. (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk authored May 1, 2024
1 parent cb698b5 commit eaf0658
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ env.CODECOV_TOKEN != '' }}
with:
files: ./cobertura.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# yamllint disable-line #;< PHP_PHAR
build-php:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-scaffold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ env.CODECOV_TOKEN != '' }}
with:
directory: ./.scaffold-coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/test-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ jobs:
path: ./.coverage-html
if-no-files-found: error

- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ env.CODECOV_TOKEN != '' && matrix.os == 'ubuntu-latest' }}
with:
directory: ./.coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Run Tests on other OSes
if: matrix.os != 'ubuntu-latest'
Expand Down

1 comment on commit eaf0658

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.