Skip to content

Commit 75620e6

Browse files
Migrate to GitHub Actions (#1473)
* add workflow yml * fix syntax error * update test command
1 parent 7c58856 commit 75620e6

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/echo.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
GO111MODULE: on
13+
GOPROXY: https://proxy.golang.org
14+
15+
jobs:
16+
test:
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
go: [1.11, 1.12, 1.13]
21+
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- name: Set up Go ${{ matrix.go }}
25+
uses: actions/setup-go@v1
26+
with:
27+
go-version: ${{ matrix.go }}
28+
29+
- name: Set GOPATH and PATH
30+
run: |
31+
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
32+
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
33+
shell: bash
34+
35+
- name: Checkout Code
36+
uses: actions/checkout@v1
37+
with:
38+
ref: ${{ github.ref }}
39+
40+
- name: Install Dependencies
41+
run: go get -v golang.org/x/lint/golint
42+
43+
- name: Run Tests
44+
run: |
45+
golint -set_exit_status ./...
46+
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
47+
48+
- name: Upload coverage to Codecov
49+
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
50+
uses: codecov/codecov-action@v1
51+
with:
52+
token:
53+
fail_ci_if_error: false

0 commit comments

Comments
 (0)