File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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-
1+ # .github/workflows/go.yml
42name : Go
53
64on :
108 branches : [ "main" ]
119
1210jobs :
13-
1411 build :
1512 runs-on : ubuntu-latest
13+
1614 steps :
17- - uses : actions/checkout@v4
15+ - uses : actions/checkout@v4
16+
17+ - name : Set up Go
18+ uses : actions/setup-go@v5
19+ with :
20+ go-version : ' go.mod'
1821
19- - name : Set up Go
20- uses : actions/setup-go@v4
21- with :
22- go-version : ' 1.20 '
22+ - name : Build app (app/main.go)
23+ run : |
24+ mkdir -p dist
25+ go build -v -o dist/app ./app
2326
24- - name : Build
25- run : go build -v ./...
27+ - name : Test (all packages)
28+ run : go test -v ./...
2629
27- - name : Test
28- run : go test -v ./...
30+ - name : Upload build artifact
31+ uses : actions/upload-artifact@v4
32+ with :
33+ name : app-linux-amd64
34+ path : dist/app
You can’t perform that action at this time.
0 commit comments