Skip to content

Update all dependencies (#401) #536

Update all dependencies (#401)

Update all dependencies (#401) #536

Workflow file for this run

name: Go
on:
push:
branches: master
pull_request:
branches: master
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.20
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51
- name: Test
run: go test -v ./...
- name: Coverage
id: coverage
run: |
go test -v -coverpkg=./... -coverprofile=cov.out ./...
go tool cover -html=cov.out -o coverage.html
COV=$(go tool cover -func=cov.out | awk '/total/ { gsub("%", "", $3); print $3 }')
echo "Total coverage: ${COV} (Required ${MIN_COV})"
(( $(echo "${COV} > ${MIN_COV}" | bc -l) )) && echo "Min coverage passed" || exit 1
env:
MIN_COV: 60
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.html
retention-days: 7