Skip to content

fix(go.mod): fix go version #6

fix(go.mod): fix go version

fix(go.mod): fix go version #6

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
- name: Check out code
uses: actions/checkout@v4
- name: Cache go mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-
- name: golangci-lint
with: { version: latest }
uses: golangci/golangci-lint-action@v4
- name: dump dependencies (for nancy)
run: go list -json -m all > go.list
- name: Nancy (deps vulnerabilities)
uses: sonatype-nexus-community/nancy-github-action@main
build:
name: build
runs-on: ubuntu-latest
needs: lint
strategy: { matrix: { go: [ '1.21.x', '1.22.x'] } }
steps:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Cache go mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-
- name: Test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Build listen example
run: go build -v ./examples/listen/
- name: Build run example
run: go build -v ./examples/run/
- name: Build tab example
run: go build -v ./examples/tab/