Skip to content

Commit 370a0b8

Browse files
committed
add github action test config file.
1 parent 2695b8e commit 370a0b8

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on: [ push, pull_request ]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [ 1.15.x, 1.16.x ]
8+
os: [ ubuntu-latest, macos-latest, windows-latest ]
9+
runs-on: ${{ matrix.os }}
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v2
13+
with:
14+
go-version: ${{ matrix.go-version }}
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Test
18+
run: go test ./...
19+
20+
test-cache:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Install Go
24+
uses: actions/setup-go@v2
25+
with:
26+
go-version: 1.16.x
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- uses: actions/cache@v2
30+
with:
31+
# In order:
32+
# * Module download cache
33+
# * Build cache (Linux)
34+
# * Build cache (Mac)
35+
# * Build cache (Windows)
36+
path: |
37+
~/go/pkg/mod
38+
~/.cache/go-build
39+
~/Library/Caches/go-build
40+
%LocalAppData%\go-build
41+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
42+
restore-keys: |
43+
${{ runner.os }}-go-
44+
- name: Test
45+
run: go test ./...

0 commit comments

Comments
 (0)