Skip to content

Commit 592c1ce

Browse files
committed
feat: add actions workflows
1 parent 60fa312 commit 592c1ce

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
go:
11+
name: runner / go
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out code into the Go module directory
17+
uses: actions/checkout@v2
18+
19+
- uses: actions/setup-go@v2
20+
with:
21+
go-version: '^1.13'
22+
23+
- uses: actions/cache@v2
24+
with:
25+
path: ~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
30+
- name: build
31+
run: go get .

.github/workflows/linter.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: linter
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
golangci-lint:
11+
name: runner / golangci-lint
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out code into the Go module directory
17+
uses: actions/checkout@v2
18+
19+
- uses: actions/setup-go@v2
20+
with:
21+
go-version: '^1.13'
22+
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@v2
25+
with:
26+
args: "--config=.github/.golangci.yml --timeout=10m"
27+
skip-go-installation: true
28+
skip-pkg-cache: true
29+
skip-build-cache: true

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
go:
11+
name: runner / go
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Set up Go ^1.13
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: '^1.13'
20+
id: go
21+
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/cache@v2
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
31+
- name: Run tests
32+
run: go test -v ./...

0 commit comments

Comments
 (0)