Replace config.IsTestEnvironment with a configuration #11
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: Go | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Check out repository | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.x | |
cache: false | |
- uses: golangci/golangci-lint-action@v3 | |
name: Install golangci-lint | |
with: | |
version: latest | |
args: --version | |
- run: make lint | |
name: Lint | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ "1.19.x", "1.20.x" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: true | |
- name: Load cached dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
- name: Download dependencies | |
run: go mod download | |
- name: Build | |
run: make build | |
- name: Test and generate coverage report | |
run: make cover |