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:
|
2022-04-21 22:24:30 +00:00
|
|
|
- main
|
2022-04-21 22:22:34 +00:00
|
|
|
- v3-dev-main
|
2022-04-21 19:18:35 +00:00
|
|
|
tags:
|
2022-04-21 22:24:30 +00:00
|
|
|
- v2.*
|
2022-04-21 22:22:34 +00:00
|
|
|
- v3.*
|
2019-12-01 07:41:49 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-04-21 22:24:30 +00:00
|
|
|
- main
|
2022-04-21 22:22:34 +00:00
|
|
|
- v3-dev-main
|
2022-09-02 17:43:07 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
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]
|
2022-08-14 14:31:53 +00:00
|
|
|
go: [1.18.x, 1.19.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:
|
2022-09-11 16:43:29 +00:00
|
|
|
- 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 }}
|
2022-04-21 19:18:35 +00:00
|
|
|
- name: Set PATH
|
2022-09-11 20:37:56 +00:00
|
|
|
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
|
2022-09-11 20:12:16 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-11 16:43:29 +00:00
|
|
|
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
|
|
|
|
run: make ensure-goimports
|
|
|
|
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
|
|
|
|
run: make lint
|
|
|
|
- run: make vet
|
2022-09-11 22:32:04 +00:00
|
|
|
- run: make test
|
|
|
|
env:
|
|
|
|
FLAGS: -tags urfave_cli_no_docs
|
2022-09-11 16:43:29 +00:00
|
|
|
- run: make test
|
|
|
|
- run: make -C cmd/urfave-cli-genflags
|
|
|
|
- run: make check-binary-size
|
2022-09-11 22:32:04 +00:00
|
|
|
env:
|
|
|
|
FLAGS: -tags urfave_cli_no_docs
|
|
|
|
- run: make check-binary-size
|
2022-09-11 16:43:29 +00:00
|
|
|
- run: make yamlfmt
|
|
|
|
- run: make diffcheck
|
2022-09-11 22:22:43 +00:00
|
|
|
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
|
|
|
|
run: make v2diff
|
2022-09-11 16:43:29 +00:00
|
|
|
- if: success() && matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
|
2022-09-05 17:07:41 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2019-12-25 17:10:48 +00:00
|
|
|
with:
|
2022-09-05 17:14:09 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2019-12-25 17:10:48 +00:00
|
|
|
fail_ci_if_error: true
|
|
|
|
|
|
|
|
test-docs:
|
|
|
|
name: test-docs
|
2020-01-14 06:13:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-25 17:10:48 +00:00
|
|
|
steps:
|
2022-09-11 16:43:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2019-12-25 17:10:48 +00:00
|
|
|
with:
|
2022-08-14 14:31:53 +00:00
|
|
|
go-version: 1.19.x
|
2022-09-11 16:43:29 +00:00
|
|
|
- uses: actions/setup-node@v3
|
2020-01-13 05:27:42 +00:00
|
|
|
with:
|
2022-04-21 19:18:35 +00:00
|
|
|
node-version: '16'
|
|
|
|
- name: Set PATH
|
2022-09-11 20:37:56 +00:00
|
|
|
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
|
2022-09-11 16:43:29 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: make ensure-gfmrun
|
|
|
|
- run: make gfmrun
|
2022-09-11 22:32:04 +00:00
|
|
|
env:
|
|
|
|
FLAGS: --walk docs/v2/
|
2022-09-11 16:43:29 +00:00
|
|
|
- run: make diffcheck
|
2022-05-09 00:49:08 +00:00
|
|
|
publish:
|
2022-09-02 17:43:07 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2022-10-02 13:19:29 +00:00
|
|
|
# TODO: switch once v3 is released {{
|
|
|
|
# if: startswith(github.ref, 'refs/tags/')
|
|
|
|
if: 'false'
|
|
|
|
# }}
|
2022-05-09 00:49:08 +00:00
|
|
|
name: publish
|
2022-05-19 02:58:46 +00:00
|
|
|
needs: [test-docs]
|
2022-05-09 00:49:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-09-11 16:43:29 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-19 03:17:57 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-09-11 22:32:04 +00:00
|
|
|
- run: make ensure-mkdocs
|
|
|
|
env:
|
|
|
|
FLAGS: --upgrade-pip
|
2022-09-11 16:43:29 +00:00
|
|
|
- run: make set-mkdocs-remote
|
|
|
|
env:
|
|
|
|
MKDOCS_REMOTE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- run: make deploy-mkdocs
|