Avoid implicit panics in middleware and middleware/throttle packages #35
Workflow file for this run
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: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
permissions: | |
contents: read | |
jobs: | |
test_and_lint: | |
name: Test, Lint, and Coverage | |
strategy: | |
matrix: | |
go: [ '1.20' ] | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
fail-fast: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Go ${{ matrix.go }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: false | |
- name: Install dependencies | |
run: go mod download | |
- name: Run tests with coverage | |
run: go test -race -cover -coverprofile="coverage.out" -covermode=atomic -v ./... | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.out | |
- name: Calculate coverage | |
run: go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}' | |
id: coverage |