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

84 lines
2.1 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:
- main
tags:
- v2.*
2019-12-01 07:41:49 +00:00
pull_request:
branches:
- main
2019-12-01 07:41:49 +00:00
jobs:
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]
go: [1.16.x, 1.17.x, 1.18.x]
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 }}
uses: actions/setup-go@v3
2019-12-01 07:45:16 +00:00
with:
2019-12-01 15:44:37 +00:00
go-version: ${{ matrix.go }}
2019-12-01 07:45:16 +00:00
- name: Set PATH
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
2019-12-01 07:45:16 +00:00
- name: Checkout Code
uses: actions/checkout@v3
2019-12-01 07:45:16 +00:00
2020-01-25 17:54:15 +00:00
- name: GOFMT Check
if: matrix.go == '1.18.x' && matrix.os == 'ubuntu-latest'
2020-01-26 12:12:27 +00:00
run: test -z $(gofmt -l .)
2020-01-25 17:54:15 +00:00
2020-02-29 07:36:34 +00:00
- name: vet
run: go run internal/build/build.go vet
- name: test
run: go run internal/build/build.go test
- name: check-binary-size
run: go run internal/build/build.go check-binary-size
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.18.x' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
2019-12-25 17:10:48 +00:00
with:
fail_ci_if_error: true
test-docs:
name: test-docs
runs-on: ubuntu-latest
2019-12-25 17:10:48 +00:00
steps:
- name: Set up Go
uses: actions/setup-go@v3
2019-12-25 17:10:48 +00:00
with:
go-version: 1.18.x
2019-12-25 17:10:48 +00:00
- name: Use Node.js 16
uses: actions/setup-node@v3
2020-01-13 05:27:42 +00:00
with:
node-version: '16'
2020-01-13 05:26:43 +00:00
- name: Set PATH
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
2019-12-25 17:10:48 +00:00
- name: Checkout Code
uses: actions/checkout@v3
2019-12-25 17:10:48 +00:00
- name: Install Dependencies
run:
mkdir -p "${GITHUB_WORKSPACE}/.local/bin" &&
curl -fsSL -o "${GITHUB_WORKSPACE}/.local/bin/gfmrun" "https://github.com/urfave/gfmrun/releases/download/v1.3.0/gfmrun-$(go env GOOS)-$(go env GOARCH)-v1.3.0" &&
chmod +x "${GITHUB_WORKSPACE}/.local/bin/gfmrun" &&
npm install -g markdown-toc@1.2.0
2019-12-06 08:34:12 +00:00
- name: gfmrun
run: go run internal/build/build.go gfmrun docs/v2/manual.md
- name: toc
run: go run internal/build/build.go toc docs/v2/manual.md