Skip to content

Commit

Permalink
Merge pull request #3 from gotray/coverage
Browse files Browse the repository at this point in the history
integration code coverage
  • Loading branch information
cpunion authored Nov 22, 2024
2 parents b2c3ba7 + 25f9914 commit 81a3c7f
Showing 1 changed file with 39 additions and 4 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/got.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ jobs:
with:
go-version: 1.23

- name: Install got
run: go install ./cmd/got
- name: Install got with coverage
run: |
go install -cover ./cmd/got
mkdir -p coverage
echo "GOCOVERDIR=$PWD/coverage" >> $GITHUB_ENV
- name: Test init project
run: got init ../foo
Expand Down Expand Up @@ -51,6 +54,21 @@ jobs:
cd ../foo
got install -v .
- name: Convert coverage data
run: |
go tool covdata textfmt -i=coverage -o coverage.integration.txt
echo "mode: atomic" > final_coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.integration.txt
flags: integration
name: codecov-umbrella
fail_ci_if_error: true


test:
continue-on-error: true
strategy:
Expand All @@ -71,8 +89,11 @@ jobs:
with:
go-version: 1.23

- name: Install got
run: go install ./cmd/got
- name: Install got with coverage
run: |
go install -cover ./cmd/got
mkdir -p coverage
echo "GOCOVERDIR=$PWD/coverage" >> $GITHUB_ENV
- name: Test init project
run: got init $HOME/foo
Expand Down Expand Up @@ -100,3 +121,17 @@ jobs:
run: |
cd $HOME/foo
got install -v .
- name: Convert coverage data
run: |
go tool covdata textfmt -i=coverage -o coverage.integration.txt
echo "mode: atomic" > final_coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.integration.txt
flags: integration
name: codecov-umbrella
fail_ci_if_error: true

0 comments on commit 81a3c7f

Please sign in to comment.