error handling w/o error slices and more #424
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: Build & Test | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- '**.go' | |
- '**.yaml' | |
- '**.yml' | |
- '**.toml' | |
- '**.json' | |
- 'go.mod' | |
- 'go.sum' | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ "main" ] | |
paths: | |
- '**.go' | |
- '**.yaml' | |
- '**.yml' | |
- '**.toml' | |
- '**.json' | |
- 'go.mod' | |
- 'go.sum' | |
jobs: | |
build: | |
name: Build & Test | |
strategy: | |
matrix: | |
go-version: ['stable', 'oldstable'] | |
platform: ['ubuntu-latest'] | |
runs-on: ${{ matrix.platform }} | |
permissions: | |
# required for security related workflows | |
security-events: write | |
# only required for workflows in private repositories | |
actions: read | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Vet | |
run: go vet ./... | |
- name: Install govulncheck | |
run: go install golang.org/x/vuln/cmd/govulncheck@latest | |
- name: Run govulncheck | |
run: govulncheck ./... | |
- name: Run Gosec Security Scanner | |
uses: securego/gosec@master | |
with: | |
# we let the report trigger content trigger a failure using the GitHub Security features. | |
args: '-no-fail -fmt sarif -out results.sarif ./...' | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
# Path to SARIF file relative to the root of the repository | |
sarif_file: results.sarif | |
- name: Build | |
run: go build ./... | |
- name: Test & Code Coverage | |
run: go test ./... -v -timeout 20m -race -count=1 -covermode=atomic -coverprofile=coverage.txt | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.txt | |
fail_ci_if_error: false | |
verbose: true | |