Skip to content

support ignite again (#96) #254

support ignite again (#96)

support ignite again (#96) #254

Workflow file for this run

name: Unit Tests
on:
pull_request:
push:
paths-ignore:
- '*.md'
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Run unit tests
run: |
go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list ./...)
- name: filter non-testable files
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 ./app -type d)"
excludelist+=" $(find ./cmd -type d)"
excludelist+=" $(find ./proto -type d)"
excludelist+=" $(find ./testutil -type d)"
excludelist+=" $(find ./tools -type d)"
for filename in ${excludelist}; do
filename=${filename#".//"}
echo "Excluding ${filename} from coverage report..."
filename=$(echo "$filename" | sed 's/\//\\\//g')
sed -i.bak "/""$filename""/d" coverage.txt
done
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
fail_ci_if_error: true
verbose: true