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

97 lines
2.6 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:
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
jobs:
2019-12-25 17:10:48 +00:00
2019-12-01 15:44:37 +00:00
test:
strategy:
matrix:
2019-12-06 05:09:25 +00:00
os: [ubuntu-latest, macos-latest, windows-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-06 10:54:53 +00:00
- name: Set GOPATH, PATH and ENV
run: |
2019-12-06 07:21:15 +00:00
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
2019-12-06 10:54:53 +00:00
echo "::set-env name=GO111MODULE::on"
2019-12-06 10:56:34 +00:00
echo "::set-env name=GOPROXY::https://proxy.golang.org"
2019-12-06 07:21:15 +00:00
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
2019-12-19 02:09:40 +00:00
- name: Run Tests
run: |
go run build.go vet
go run build.go test
2019-12-19 02:09:40 +00:00
2019-12-25 17:10:48 +00:00
- name: Upload coverage to Codecov
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: 0a8cc73b-bb7c-480b-8626-38a461643761
fail_ci_if_error: true
test-docs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.13]
name: test-docs
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Set GOPATH, PATH and ENV
2019-12-19 02:09:40 +00:00
run: |
2019-12-25 17:10:48 +00:00
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
echo "::set-env name=GO111MODULE::on"
echo "::set-env name=GOPROXY::https://proxy.golang.org"
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
2019-12-25 17:10:48 +00:00
- name: Checkout Code
uses: actions/checkout@v1
with:
ref: ${{ github.ref }}
- name: Install Dependencies
2019-12-06 08:34:12 +00:00
run: |
2019-12-25 17:10:48 +00:00
mkdir -p $GOPATH/bin
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
npm install markdown-toc
2019-12-06 08:34:12 +00:00
2019-12-25 17:10:48 +00:00
- name: Run Tests (v1)
if: contains(github.base_ref, 'v1')
2019-12-06 08:34:12 +00:00
run: |
2019-12-25 17:10:48 +00:00
go run build.go gfmrun docs/v1/manual.md
go run build.go toc docs/v1/manual.md
2019-12-06 08:34:12 +00:00
2019-12-25 17:10:48 +00:00
- name: Run Tests (v2)
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