Skip to content

Commit

Permalink
Update Github Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Jan 20, 2024
1 parent 10274eb commit e63d825
Showing 1 changed file with 37 additions and 39 deletions.
76 changes: 37 additions & 39 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Go
on: [push, pull_request]
jobs:

build:
name: Build
runs-on: ${{ matrix.os }}
Expand All @@ -10,41 +9,40 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.50.0
args: --timeout 10m

- name: Vet
if: matrix.os == 'ubuntu-latest'
run: go vet -v ./...

- name: Build
env:
CGO_ENABLED: 0
run: go build -ldflags "-s -w" ./...

- name: Test
run: go test -v -race ./...
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.54.2
args: --timeout 10m

- name: Vet
if: matrix.os == 'ubuntu-latest'
run: go vet -v ./...

- name: Build
env:
CGO_ENABLED: 0
run: go build -ldflags "-s -w" ./...

- name: Test
run: go test -v -race ./...

0 comments on commit e63d825

Please sign in to comment.