Merge pull request #439 from persistenceOne/puneet/udpates #248
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-coverage-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- uses: actions/checkout@v4 | |
- name: test & coverage report creation | |
run: | | |
make test | |
env: | |
TEST_TARGET: "./..." | |
TEST_ARGS: "-timeout 12m -race -coverprofile=./coverage.out -covermode=atomic -v" | |
- name: filter out DONTCOVER | |
if: github.event_name == 'pull_request' | |
run: | | |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" | |
excludelist+=" $(find ./ -type f -name '*.pb.go')" | |
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" | |
excludelist+=" $(find ./ -type f -path './tests/*.go')" | |
excludelist+=" $(find ./ -type f -path './x/interchainquery/*')" | |
excludelist+=" $(find ./ -type f -path './x/oracle/*')" | |
for filename in ${excludelist}; do | |
filename=$(echo $filename | sed 's/^.\///g') | |
echo "Excluding ${filename} from coverage report..." | |
sed -i "/$(echo $filename | sed 's/\//\\\//g')/d" ./coverage.out | |
done | |
- name: Convert coverage to lcov | |
if: github.event_name == 'pull_request' | |
uses: jandelgado/gcov2lcov-action@v1 | |
- name: Coveralls | |
if: github.event_name == 'pull_request' | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: coverage.lcov | |
- name: Code Coverage Report | |
if: github.event_name == 'pull_request' | |
uses: vebr/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lcov-file: coverage.lcov |