Merge pull request #8 from robertranjan/workflow-warnings #56
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 and test | |
# on: [push] | |
on: | |
push: | |
branches: | |
- "main" | |
schedule: | |
- cron: "0 6 * * 3" | |
jobs: | |
build-test-staticcheck: | |
name: Build, Test and Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
# - name: Restore Cache | |
# uses: actions/cache@v3 | |
# id: cache | |
# with: | |
# path: ~/go/pkg | |
# key: 1.22-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
# Require: The version of golangci-lint to use. | |
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. | |
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. | |
version: v1.57 | |
- name: Build | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
go build -v -o bin/ | |
- name: Test | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
go test -v ./... |