2019-12-01 16:06:16 +00:00
|
|
|
name: Run Tests
|
2019-12-01 07:41:49 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
master
|
|
|
|
|
2019-12-01 16:06:16 +00:00
|
|
|
env:
|
|
|
|
GO111MODULE: on
|
|
|
|
GOPROXY: https://proxy.golang.org
|
|
|
|
|
2019-12-01 07:41:49 +00:00
|
|
|
jobs:
|
2019-12-01 15:44:37 +00:00
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-12-01 16:06:16 +00:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2019-12-01 15:44:37 +00:00
|
|
|
go: [1.11, 1.12, 1.13]
|
2019-12-01 16:06:16 +00:00
|
|
|
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
|
2019-12-01 15:44:37 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-12-01 07:41:49 +00:00
|
|
|
steps:
|
2019-12-01 15:44:37 +00:00
|
|
|
- name: Set up Go ${{ matrix.go }}
|
2019-12-01 07:45:16 +00:00
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2019-12-01 15:44:37 +00:00
|
|
|
go-version: ${{ matrix.go }}
|
2019-12-01 07:45:16 +00:00
|
|
|
|
2019-12-01 15:55:06 +00:00
|
|
|
- name: Set GOPATH and PATH
|
|
|
|
run: |
|
|
|
|
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
|
|
|
|
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
|
|
|
|
shell: bash
|
|
|
|
|
2019-12-01 07:45:16 +00:00
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
with:
|
2019-12-01 15:44:37 +00:00
|
|
|
ref: ${{ github.ref }}
|
2019-12-01 07:45:16 +00:00
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
go get github.com/urfave/gfmrun/cmd/gfmrun
|
|
|
|
go get golang.org/x/tools/cmd/goimports
|
2019-12-01 16:06:16 +00:00
|
|
|
go get ./...
|
2019-12-01 07:45:16 +00:00
|
|
|
npm install markdown-toc
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
2019-12-01 15:44:37 +00:00
|
|
|
ls -la
|
2019-12-01 07:45:16 +00:00
|
|
|
go run build.go vet
|
|
|
|
go run build.go test
|
|
|
|
go run build.go gfmrun docs/v2/manual.md
|
|
|
|
go run build.go toc docs/v2/manual.md
|
2019-12-01 17:29:04 +00:00
|
|
|
|
|
|
|
- name: Send Coverage Report
|
|
|
|
if: success()
|
|
|
|
run: bash <(curl -s https://codecov.io/bash)
|