Skip to content

Commit

Permalink
Merge pull request rancher#11442 from rancher/11106-codecov
Browse files Browse the repository at this point in the history
Upload Codecov report using CLI
  • Loading branch information
torchiaf authored Jul 25, 2024
2 parents a470ad3 + 338f821 commit 9506d6f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/scripts/install-codecov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
curl -Os https://cli.codecov.io/latest/linux/codecov
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM

shasum -a 256 -c codecov.SHA256SUM
sudo chmod +x codecov
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,30 @@ jobs:
- name: Run tests
uses: ./.github/actions/lint

coverage:
runs-on: ubuntu-latest
needs:
- unit-test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Download Coverage Artifacts
uses: actions/download-artifact@v3
with:
name: ${{github.run_number}}-${{github.run_attempt}}-coverage

- name: Install Codecov CLI
run : .github/workflows/scripts/install-codecov.sh

- name: Upload tests coverage report to Codecov
run: ./codecov --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n ${{github.run_number}}-${{github.run_attempt}}-coverage -F unit -f ./coverage/coverage-unit.json

check-e2e-tags:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ scripts/standalone/node
# yarn.lock files
docusaurus/yarn.lock
storybook/yarn.lock

# GitHub actions scripts output
codecov

0 comments on commit 9506d6f

Please sign in to comment.