-
Notifications
You must be signed in to change notification settings - Fork 493
77 lines (72 loc) · 1.76 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches: [ master ]
jobs:
checks:
name: Code style
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Check suspicious constructs
run: make vet
- name: Check order of imports
run: make goimports-check
- name: Check if modules were tidied up
run: make tidy-check
generated:
name: Generated code
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: make deps
- name: Check whether go generate has run
run: export PATH=$(npm bin):$PATH && make generate
build_and_test:
name: Build and test
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Compile
run: make build
- name: Tests
run: make test
- name: Build bosun binary
run: make bosun
- name: Test startup
run: build/test-startup.sh
cross-compile:
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ "linux", "darwin", "windows" ]
name: Build ${{ matrix.os }} binary
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Build ${{ matrix.os }} binary
run: make build-${{ matrix.os }}