Skip to content

Commit 0cb422e

Browse files
committed
github: add github workflows and codecov for test
1 parent dc9e1dc commit 0cb422e

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: "master"
6+
pull_request:
7+
branches: "*"
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
go-version: [ 1.12.x, 1.13.x, 1.14.x ]
15+
os: [ ubuntu-latest, macos-latest ]
16+
env:
17+
OS: ${{ matrix.os }}
18+
GO_VERSION: ${{ matrix.go-version }}
19+
steps:
20+
- name: Install Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: ${{ matrix.go-version }}
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Install nvim binary
29+
run: |
30+
case "$RUNNER_OS" in
31+
Linux)
32+
curl -sSL https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz | sudo tar xfz - --strip-components=1 -C '/usr/local'
33+
;;
34+
macOS)
35+
curl -sSL https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz | sudo tar xfz - --strip-components=1 -C '/usr/local'
36+
;;
37+
esac
38+
nvim --version
39+
40+
- name: Test
41+
run: |
42+
go test -v -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
43+
44+
- uses: codecov/[email protected]
45+
with:
46+
file: ./coverage.out
47+
env_vars: OS,GO_VERSION
48+
fail_ci_if_error: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ _testmain.go
2222
*.exe
2323
*.test
2424
*.prof
25+
26+
coverage.*

0 commit comments

Comments
 (0)