Update ci.yml

upgrade actions/setup-go@v4 to support cache by default
This commit is contained in:
Sun Yimin 2023-05-24 17:22:01 +08:00 committed by GitHub
parent 6e9ba588f9
commit 5817b08c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,23 +18,10 @@ jobs:
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goVer }}
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Module cache
uses: actions/cache@v3
env:
cache-name: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
- name: Test with Coverage
run: go test -coverpkg=./... -v -short -coverprofile=coverage1.txt -covermode=atomic ./...
env:
@ -48,4 +35,4 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage1.txt,./coverage2.txt
files: ./coverage1.txt,./coverage2.txt