Skip to content

Commit 6d8b35f

Browse files
committed
Rewrite the workflow to be simpler
The previous setup I had was trying to do too much. This setup is easier to follow, it setups github to build a binary if all tests pass.
1 parent 2387dc6 commit 6d8b35f

1 file changed

Lines changed: 26 additions & 22 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@ name: CI Checks
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
78
jobs:
89
build:
9-
name Build App
10-
runs-on: ubuntu-latest
11-
steps:
10+
name: Build App
11+
runs-on: ubuntu-latest
1212

13-
- name: Set up Go 1.25.0
14-
uses: actions/setup-go@v4
15-
with:
16-
go-version: ^1.25.0
13+
steps:
14+
# step 1: clone the repo so it can be seen
15+
- name: Check out code
16+
uses: actions/checkout@v4
1717

18-
- name: Check out code into the Go module directory
19-
uses: actions/checkout@v4
18+
# step 2: setup the go toolchain
19+
- name: Set up Go 1.25.0
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.25'
2023

21-
- name: Build
22-
uses: make build
24+
# step 3: install dependencies
25+
- name: Install dependencies
26+
run: go mod download
2327

24-
- name: Copy Files
25-
run: |
26-
mkdir artifacts
27-
cp drumstick artifacts/.
28+
# step 4: run tests
29+
- name: Tests
30+
run: go test -v ./...
2831

29-
- name: Archive
30-
uses: actions/upload-artifact@v4
31-
with:
32-
name: drumstick
33-
path: artifacts
32+
# step 5: If the tests are successful, build
33+
- name: Build
34+
run: go build -v ./...
35+
36+
37+

0 commit comments

Comments
 (0)