Skip to content

Commit

Permalink
integration code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Nov 22, 2024
1 parent bdbadfd commit cb450ff
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 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,23 @@ 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
cat coverage.unit.out | grep -v "mode: atomic" >> final_coverage.txt
cat coverage.integration.txt | grep -v "mode: atomic" >> final_coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./final_coverage.txt
flags: integration
name: codecov-umbrella
fail_ci_if_error: true


test:
continue-on-error: true
strategy:
Expand All @@ -71,8 +91,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 +123,19 @@ 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
cat coverage.unit.out | grep -v "mode: atomic" >> final_coverage.txt
cat coverage.integration.txt | grep -v "mode: atomic" >> final_coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./final_coverage.txt
flags: integration
name: codecov-umbrella
fail_ci_if_error: true

0 comments on commit cb450ff

Please sign in to comment.