Skip to content

Commit 652d928

Browse files
authored
chore: add github action for PR testing (#332)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent 5699547 commit 652d928

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: pull-request
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
unit-test:
8+
strategy:
9+
matrix:
10+
go-version: [1.10.x, 1.11.x, 1.12.x, 1.13.x]
11+
platform: [ubuntu-latest]
12+
runs-on: ${{ matrix.platform }}
13+
steps:
14+
- name: Install Go
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: ${{ matrix.go-version }}
18+
- name: checkout
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 1
22+
- name: Get dependencies
23+
run: go mod download || go get -t
24+
- name: Run unit tests
25+
run: go test -v ./...
26+
build-test:
27+
strategy:
28+
matrix:
29+
go-version: [1.13.x]
30+
platform: [ubuntu-latest]
31+
arch: [386, amd64, arm, arm64]
32+
runs-on: ${{ matrix.platform }}
33+
steps:
34+
- name: Install Go
35+
uses: actions/setup-go@v1
36+
with:
37+
go-version: ${{ matrix.go-version }}
38+
- name: checkout
39+
uses: actions/checkout@v2
40+
with:
41+
fetch-depth: 1
42+
- name: Get dependencies
43+
run: go mod download
44+
- name: Test to build binary
45+
run: GOARCH=${{ matrix.arch }} go build ./...

0 commit comments

Comments
 (0)