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-05 17:44:25 +00:00
|
|
|
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
|
|
|
|
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: |
|
2019-12-05 17:44:25 +00:00
|
|
|
curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-linux-amd64 | grep download | cut -d '"' -f 4 | wget -O $(dirname $GITHUB_WORKSPACE)/bin/gfmrun -i -
|
2019-12-01 07:45:16 +00:00
|
|
|
npm install markdown-toc
|
|
|
|
|
2019-12-05 17:44:25 +00:00
|
|
|
- name: Run Tests (v1)
|
|
|
|
if: contains(github.ref, 'v1')
|
|
|
|
run: |
|
|
|
|
go run build.go vet
|
|
|
|
go run build.go test
|
|
|
|
go run build.go gfmrun docs/v1/manual.md
|
|
|
|
go run build.go toc docs/v1/manual.md
|
|
|
|
|
|
|
|
- name: Run Tests (v2)
|
|
|
|
if: contains(github.ref, 'master')
|
2019-12-01 07:45:16 +00:00
|
|
|
run: |
|
|
|
|
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()
|
2019-12-02 09:03:48 +00:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
2019-12-01 17:29:04 +00:00
|
|
|
run: bash <(curl -s https://codecov.io/bash)
|