Updated User-Agent to "Gemfury CLI …" #92
This file contains 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: build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- name: Download modules | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: go mod download | |
- name: Run tests | |
run: go test -coverprofile coverage.out ./... | |
- name: Check code coverage | |
run: | | |
go tool cover -func coverage.out | grep total | \ | |
awk '{ if (70 <= substr($3, 1, length($3)-1)) { \ | |
print("Coverage: " $3, "OK"); \ | |
} else { \ | |
print("Coverage: " $3, "FAIL"); \ | |
exit(1) \ | |
}}' |