Skip to content

Commit d71680c

Browse files
committed
added test actions
1 parent 8b9e75f commit d71680c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches:
4+
- "main"
5+
tags:
6+
- "v*.*.*"
7+
pull_request:
8+
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
# https://github.com/actions/setup-go/issues/21#issuecomment-565704236
16+
- name: Install gotip
17+
run: |
18+
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
19+
cd $HOME/gotip/src
20+
./make.bash
21+
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
22+
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH
23+
- name: Check out code into the Go module directory
24+
uses: actions/checkout@v1
25+
- name: Declare some variables
26+
id: vars
27+
run: |
28+
echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
29+
- name: Test Coverage (pkg)
30+
run: go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}
31+
- name: Upload coverage
32+
uses: codecov/codecov-action@v2
33+
with:
34+
files: ${{ steps.vars.outputs.coverage_txt }}
35+

0 commit comments

Comments
 (0)