forked from mackerelio/go-check-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (85 loc) · 2.65 KB
/
test.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
82
83
84
85
86
---
name: test
on:
push:
branches:
- master
pull_request:
env:
GO111MODULE: on
DEBIAN_FRONTEND: noninteractive
jobs:
test:
strategy:
matrix:
go: ["1.14.x"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- run: sudo apt-get install memcached
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
make lint cover testconvention test
test-windows:
strategy:
matrix:
go: ["1.14.x"]
runs-on: windows-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
go build -o check-log/check-log.exe ./check-log
go build -o check-procs/check-procs.exe ./check-procs
go build -o check-windows-eventlog/check-windows-evenglog.exe ./check-windows-eventlog
go test ./check-log/... ./check-procs/... ./check-ntservice/... ./check-windows-eventlog/...
release:
needs: [test, test-windows]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- run: |
sudo apt-get update
sudo apt-get install -y rpm devscripts debhelper fakeroot crossbuild-essential-arm64
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v2
with:
go-version: 1.14.x
- uses: actions/checkout@v2
- run: |
go get github.com/x-motemen/gobump/cmd/gobump
go get github.com/mackerelio/golib/cmd/mackerel-github-release
make clean build rpm deb
mackerel-github-release && mackerel-github-release -staging
env:
GITHUB_TOKEN: ${{ secrets.MACKERELBOT_GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,action,eventName,ref,workflow,job,took
username: go-check-plugins-release
env:
SLACK_WEBHOOK_URL: ${{ secrets.MACKEREL_SLACK_WEBHOOK_URL }}