Skip to content

Commit ce9b454

Browse files
Create go.yml
1 parent a3cfcc3 commit ce9b454

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/go.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.23'
23+
- name: Cache Go dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
31+
- name: Build
32+
run: go build -v ./...
33+
34+
- name: Test
35+
run: go test -v ./...
36+
- name: Run golint
37+
run: golint ./...
38+
- name: Run gofmt
39+
run: gofmt -d ./
40+
- name: Run go vet
41+
run: go vet ./...

0 commit comments

Comments
 (0)