Skip to content

Commit 3ed5baf

Browse files
authored
Merge pull request #17 from mackerelio/use-workflow
Upgrade Go 1.22 and 1.21 by reusable workflow
2 parents ba7afc5 + 6c97e7e commit 3ed5baf

3 files changed

Lines changed: 14 additions & 33 deletions

File tree

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ on:
66
- "v[0-9]+.[0-9]+.[0-9]+"
77
jobs:
88
goreleaser:
9-
uses: mackerelio/workflows/.github/workflows/goreleaser.yml@main
10-
9+
uses: mackerelio/workflows/.github/workflows/goreleaser.yml@v1.1.0

.github/workflows/test.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,20 @@ name: test
44
on:
55
push:
66
branches:
7-
- master
7+
- main
88
tags:
99
- v*
1010
pull_request:
1111
env:
1212
DEBIAN_FRONTEND: noninteractive
1313
jobs:
1414
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
15+
uses: mackerelio/workflows/.github/workflows/go-lint.yml@v1.1.0
2416
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
17+
uses: mackerelio/workflows/.github/workflows/go-test.yml@v1.1.0
18+
testci:
19+
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.1.0
20+
with:
21+
os-versions: '["ubuntu-22.04"]'
22+
run: |
23+
make testci

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ build:
33
go build -o mackerel-plugin-mysql
44

55
.PHONY: test
6-
test: testgo build
6+
test: testgo build testci
7+
8+
.PHONY: testci
9+
testci:
710
go install github.com/lufia/graphitemetrictest/cmd/graphite-metric-test@latest
811
./test.sh
912

0 commit comments

Comments
 (0)