Improved build. .env and config.yaml exposed for this example's purpo… #29
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: Go Test and Coverage | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
name: Test and coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
check-latest: true | |
- name: Verify dependencies | |
run: | | |
go mod verify | |
go mod download | |
go mod tidy | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 | |
- name: Run golangci-lint | |
run: golangci-lint run | |
- name: Run tests with coverage | |
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.txt | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
verbose: true |