mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 20:07:53 -06:00
fix: only run coverage upload if secret is available
This commit is contained in:
6
.github/workflows/coverage.yaml
vendored
6
.github/workflows/coverage.yaml
vendored
@@ -9,6 +9,8 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -49,13 +51,13 @@ jobs:
|
|||||||
just coverage
|
just coverage
|
||||||
|
|
||||||
- name: Download Coveralls CLI
|
- name: Download Coveralls CLI
|
||||||
|
if: ${{ env.COVERALLS_REPO_TOKEN != '' }}
|
||||||
run: |
|
run: |
|
||||||
# use GitHub Releases URL instead of coveralls.io because they can't maintain their own files; it 404s
|
# use GitHub Releases URL instead of coveralls.io because they can't maintain their own files; it 404s
|
||||||
curl -L https://github.com/coverallsapp/coverage-reporter/releases/download/v0.6.15/coveralls-linux-x86_64.tar.gz | tar -xz -C /usr/local/bin
|
curl -L https://github.com/coverallsapp/coverage-reporter/releases/download/v0.6.15/coveralls-linux-x86_64.tar.gz | tar -xz -C /usr/local/bin
|
||||||
|
|
||||||
- name: Upload coverage to Coveralls
|
- name: Upload coverage to Coveralls
|
||||||
env:
|
if: ${{ env.COVERALLS_REPO_TOKEN != '' }}
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f "lcov.info" ]; then
|
if [ ! -f "lcov.info" ]; then
|
||||||
echo "Error: lcov.info file not found. Coverage generation may have failed."
|
echo "Error: lcov.info file not found. Coverage generation may have failed."
|
||||||
|
|||||||
Reference in New Issue
Block a user