Skip to content

Commit 4c3d7dc

Browse files
committed
added ci
1 parent 16ffb61 commit 4c3d7dc

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: test
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- v*
10+
pull_request:
11+
env:
12+
DEBIAN_FRONTEND: noninteractive
13+
jobs:
14+
lint:
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: golangci/golangci-lint-action@v3
22+
with:
23+
args: --timeout 2m
24+
test:
25+
strategy:
26+
matrix:
27+
go: ["1.19.x", "1.18.x"]
28+
os: [ubuntu-latest]
29+
runs-on: ${{ matrix.os }}
30+
steps:
31+
- uses: actions/setup-go@v2
32+
with:
33+
go-version: ${{ matrix.go }}
34+
- uses: actions/checkout@v2
35+
- uses: actions/cache@v2
36+
with:
37+
path: ~/go/pkg/mod
38+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
39+
restore-keys: |
40+
${{ runner.os }}-go-
41+
- run: |
42+
make test
43+
- run: |
44+
./test.sh

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.PHONY: build
2+
build:
3+
go build -o mackerel-plugin-mongodb
4+
5+
.PHONY: test
6+
test: testgo build
7+
go install github.com/lufia/graphitemetrictest/cmd/graphite-metric-test@latest
8+
./test.sh
9+
10+
.PHONY: testgo
11+
testgo:
12+
go test -v ./...
13+

0 commit comments

Comments
 (0)