Skip to content

Commit 2688218

Browse files
authored
Merge pull request #20 from swarmpit/ci/build-and-test
travis has been dead for years, have some actions
2 parents 4c18c87 + f901a8e commit 2688218

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test & Build
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
pull_request:
7+
branches: [ 'master' ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
go:
12+
name: Test & Build Go
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v4
17+
# toolchain comes from the image the Dockerfile builds with, so ci can't
18+
# drift from the release build
19+
- name: vet, test & build
20+
run: |
21+
docker run --rm -v "$PWD":/build -w /build -e CGO_ENABLED=0 golang:1.12 \
22+
sh -c 'go vet ./... && go test ./... && go build -o agent .'
23+
24+
docker:
25+
name: Build docker
26+
needs: go
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: checkout
30+
uses: actions/checkout@v4
31+
# same arch matrix deploy-image.sh releases; go cross-compiles so no
32+
# emulation is needed
33+
- name: build release architectures
34+
run: |
35+
docker build --build-arg GOARCH=amd64 -t agent:amd64 .
36+
docker build --build-arg GOARCH=arm64 -t agent:arm64 .
37+
docker build --build-arg GOARCH=arm --build-arg GOARM=7 -t agent:armv7 .
38+
docker build --build-arg GOARCH=arm --build-arg GOARM=6 -t agent:armv6 .

0 commit comments

Comments
 (0)