Skip to content

Commit bb9d430

Browse files
committed
Added a GitHub action to perform tests, generate binaries.
1 parent 8ae70ee commit bb9d430

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/build.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test and build Go
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.20'
20+
cache-dependency-path: go.sum
21+
22+
- name: Install dependencies
23+
run: |
24+
go get .
25+
26+
- name: Run tests
27+
run: go test -v
28+
29+
build:
30+
runs-on: ubuntu-latest
31+
needs: test
32+
if: github.ref == 'refs/heads/master'
33+
strategy:
34+
matrix:
35+
os: [ linux, darwin ]
36+
arch: [ amd64, arm64 ]
37+
38+
steps:
39+
- name: Check out
40+
uses: actions/checkout@v4
41+
42+
- uses: wangyoucao577/go-release-action@v1
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
goos: ${{ matrix.os }}
46+
goarch: ${{ matrix.arch }}
47+
release_tag: latest
48+
binary_name: gobbler
49+
overwrite: true

0 commit comments

Comments
 (0)