File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build CI/CD
22
33on :
4- push :
4+ push :
55 branches :
66 - main
77
88jobs :
9- test :
9+ test :
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Checkout code
13- uses : actions/checkout@v4
13+ uses : actions/checkout@v4
1414
1515 - name : Set up Go
16- uses : actions/setup-go@v5
17- with :
18- go-version : ' 1.22'
16+ uses : actions/setup-go@v5
17+ with :
18+ go-version : ' 1.22'
1919
2020 - name : Install dependencies
21- run : go mod download
21+ run : go mod download
2222
2323 - name : Run tests
24- run : go test ./...
24+ run : go test ./...
2525
26- compile :
26+ compile :
2727 runs-on : ubuntu-latest
2828 needs : test
2929 if : success()
3030 steps :
3131 - name : Checkout code
32- uses : actions/checkout@v4
32+ uses : actions/checkout@v4
3333
3434 - name : Set up Go
35- uses : actions/setup-go@v5
36- with :
37- go-version : ' 1.22'
35+ uses : actions/setup-go@v5
36+ with :
37+ go-version : ' 1.22'
3838
3939 - name : Install dependencies
40- run : go mod download
40+ run : go mod download
4141
4242 - name : Compile binary
43- run : go build -o myapp
43+ run : go build -o myapp
You can’t perform that action at this time.
0 commit comments