urfave-cli/.github/workflows/cli.yml

66 lines
1.7 KiB
YAML
Raw Normal View History

2019-12-01 16:06:16 +00:00
name: Run Tests
2019-12-01 07:41:49 +00:00
on:
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
- 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"
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
2019-12-01 07:45:16 +00:00
npm install markdown-toc
- 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)