-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.34 KB
/
workflow-sample2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Simple Go Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go version
uses: actions/setup-go@v5
with:
go-version: '1.22.0'
- name: run go
run: go run hello.go
- name: build go
run: go build -o build/hello hello.go
- name: Upload Go binary as artifact
uses: actions/upload-artifact@v4
with:
name: hello-binary
path: build/hello
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Set Test
id: set-test-stage
run: echo ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
dev:
name: Dev
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Set Dev
id: set-dev-stage
run: echo ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run:
name: Run
needs: [ test, dev ]
runs-on: ubuntu-latest
steps:
- name: Download Go binary artifact
uses: actions/download-artifact@v4
with:
name: hello-binary
path: build/
- name: Set execute permission
run: chmod +x build/hello
- name: Run Go binary
run: ./build/hello