Skip to content

Commit 57e36d5

Browse files
authored
Merge pull request #87 from thaJeztah/github_actions
Add GitHub Actions
2 parents 32b7f00 + 88388a9 commit 57e36d5

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
linux:
12+
name: Test ${{ matrix.platform }} (${{ matrix.go }})
13+
timeout-minutes: 10
14+
strategy:
15+
matrix:
16+
go: ["1.13.x", "1.15.x", "1.16.x"]
17+
platform: [ubuntu-20.04]
18+
runs-on: ${{ matrix.platform }}
19+
steps:
20+
- name: Install Go ${{ matrix.go }}
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: ${{ matrix.go }}
24+
- name: Setup IPv6
25+
run: sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
- name: Build for ${{ matrix.platform }}
29+
run: go build ./...
30+
- name: Test
31+
run: go test -exec sudo -v ./...
32+
33+
other:
34+
name: Test ${{ matrix.platform }} (${{ matrix.go }})
35+
timeout-minutes: 10
36+
strategy:
37+
matrix:
38+
go: ["1.13.x", "1.15.x", "1.16.x"]
39+
platform: [windows-latest, macos-latest]
40+
runs-on: ${{ matrix.platform }}
41+
steps:
42+
- name: Install Go ${{ matrix.go }}
43+
uses: actions/setup-go@v2
44+
with:
45+
go-version: ${{ matrix.go }}
46+
- name: Checkout code
47+
uses: actions/checkout@v2
48+
- name: Build for ${{ matrix.platform }}
49+
run: go build ./...
50+
- name: Test
51+
run: go test -v ./...
52+
53+
lint:
54+
name: Lint ${{ matrix.platform }}
55+
timeout-minutes: 10
56+
strategy:
57+
matrix:
58+
platform: [ubuntu-20.04, windows-latest, macos-latest]
59+
runs-on: ${{ matrix.platform }}
60+
steps:
61+
- uses: actions/checkout@v2
62+
- uses: golangci/golangci-lint-action@v2
63+
with:
64+
# must be specified without patch version
65+
version: v1.41

0 commit comments

Comments
 (0)