2019-12-01 16:06:16 +00:00
|
|
|
name: Run Tests
|
2019-12-01 07:41:49 +00:00
|
|
|
|
|
|
|
on:
|
2019-12-18 08:40:37 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-12-19 02:11:43 +00:00
|
|
|
- v1
|
2019-12-01 07:41:49 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2019-12-05 17:47:53 +00:00
|
|
|
- master
|
|
|
|
- v1
|
2019-12-01 07:41:49 +00:00
|
|
|
|
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-02 09:03:48 +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
|
|
|
|
2020-01-13 13:32:13 +00:00
|
|
|
- name: Use Node.js 12.x
|
2020-01-13 05:27:42 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-01-13 13:32:13 +00:00
|
|
|
node-version: 12.x
|
2020-01-13 05:26:43 +00:00
|
|
|
|
2019-12-01 15:55:06 +00:00
|
|
|
- name: Set GOPATH and PATH
|
|
|
|
run: |
|
2019-12-07 06:47:22 +00:00
|
|
|
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
|
|
|
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
|
2019-12-01 15:55:06 +00:00
|
|
|
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: |
|
2019-12-05 17:57:48 +00:00
|
|
|
mkdir -p $GOPATH/bin
|
2019-12-07 06:47:22 +00:00
|
|
|
curl -L -o $GOPATH/bin/gfmrun "https://github.com/urfave/gfmrun/releases/download/v1.2.14/gfmrun-$(go env GOOS)-amd64-v1.2.14"
|
|
|
|
chmod +x $GOPATH/bin/gfmrun
|
2020-01-13 13:29:36 +00:00
|
|
|
npm install -g markdown-toc@1.2.0
|
2019-12-01 07:45:16 +00:00
|
|
|
|
2019-12-19 02:09:40 +00:00
|
|
|
- name: Run Tests
|
2019-12-05 17:44:25 +00:00
|
|
|
run: |
|
|
|
|
go run build.go vet
|
|
|
|
go run build.go test
|
2019-12-19 02:09:40 +00:00
|
|
|
|
|
|
|
- name: Run Tests (v1)
|
|
|
|
if: contains(github.base_ref, 'v1')
|
|
|
|
run: |
|
2019-12-05 17:44:25 +00:00
|
|
|
go run build.go gfmrun docs/v1/manual.md
|
|
|
|
go run build.go toc docs/v1/manual.md
|
|
|
|
|
|
|
|
- name: Run Tests (v2)
|
2019-12-06 04:42:58 +00:00
|
|
|
if: contains(github.base_ref, 'master')
|
2019-12-01 07:45:16 +00:00
|
|
|
run: |
|
|
|
|
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
|
|
|
|
2019-12-13 07:58:11 +00:00
|
|
|
- name: Upload coverage to Codecov
|
2019-12-08 12:32:18 +00:00
|
|
|
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
|
2019-12-13 07:58:11 +00:00
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: 0a8cc73b-bb7c-480b-8626-38a461643761
|
|
|
|
fail_ci_if_error: true
|