Skip to content

Commit dfd14e7

Browse files
committed
chore: switch travis to github actions.
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 18020fa commit dfd14e7

File tree

2 files changed

+67
-33
lines changed

2 files changed

+67
-33
lines changed

.github/workflows/go.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Setup go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: '^1.16'
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
- name: Setup golangci-lint
22+
uses: golangci/golangci-lint-action@v2
23+
with:
24+
version: v1.42.1
25+
args: --verbose
26+
test:
27+
strategy:
28+
matrix:
29+
os: [ubuntu-latest, macos-latest]
30+
go: [1.13, 1.14, 1.15, 1.16, 1.17]
31+
include:
32+
- os: ubuntu-latest
33+
go-build: ~/.cache/go-build
34+
- os: macos-latest
35+
go-build: ~/Library/Caches/go-build
36+
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
37+
runs-on: ${{ matrix.os }}
38+
env:
39+
GO111MODULE: on
40+
GOPROXY: https://proxy.golang.org
41+
steps:
42+
- name: Set up Go ${{ matrix.go }}
43+
uses: actions/setup-go@v2
44+
with:
45+
go-version: ${{ matrix.go }}
46+
47+
- name: Checkout Code
48+
uses: actions/checkout@v2
49+
with:
50+
ref: ${{ github.ref }}
51+
52+
- uses: actions/cache@v2
53+
with:
54+
path: |
55+
${{ matrix.go-build }}
56+
~/go/pkg/mod
57+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58+
restore-keys: |
59+
${{ runner.os }}-go-
60+
- name: Run Tests
61+
run: |
62+
go test -v -covermode=atomic -coverprofile=coverage.out
63+
64+
- name: Upload coverage to Codecov
65+
uses: codecov/codecov-action@v2
66+
with:
67+
flags: ${{ matrix.os }},go-${{ matrix.go }}

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)