-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (74 loc) · 1.86 KB
/
build.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
steps:
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- name: Cache go.mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Vet
run: go vet ./...
- name: Test
run: go test -v ./...
- name: Build
run: go build -v ./...
build:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
strategy:
matrix:
include:
- label: armv5
arch: arm
arm: 5
- label: armv6
arch: arm
arm: 6
- label: armv7
arch: arm
arm: 7
- label: arm64
arch: arm64
- label: amd64
arch: amd64
- label: i386
arch: 386
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.17.x
- uses: actions/checkout@v4
- name: Cache go.mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -v ./...
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
GOARM: ${{ matrix.arm }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: avahi2dns-linux-${{ matrix.label }}
path: avahi2dns