Skip to content

Update go workflow files versions #2738

Update go workflow files versions

Update go workflow files versions #2738

Workflow file for this run

name: Go Test
on: push
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
name: Setup GO Env
with:
go-version: '1.20'
- name: Cache Go Test modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-test-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-test-
- name: Run Unit Tests with Coverage
run: >-
for d in $(go list ./... | grep -v e2e); do
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage.txt
flags: unittests
name: codecov-umbrella
verbose: true