Skip to content

Commit 7e04fe3

Browse files
authored
Update go.yml
1 parent 1d80f8c commit 7e04fe3

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/go.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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
42
name: Go
53

64
on:
@@ -10,19 +8,27 @@ on:
108
branches: [ "main" ]
119

1210
jobs:
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

0 commit comments

Comments
 (0)