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

95 lines
2.5 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
- v3-dev-main
tags:
- v2.*
- v3.*
2019-12-01 07:41:49 +00:00
pull_request:
branches:
- main
- v3-dev-main
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]
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:
- 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 }}
- name: Set PATH
2022-09-11 20:37:56 +00:00
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
- uses: actions/checkout@v3
- 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:
2022-09-11 22:34:13 +00:00
GFLAGS: -tags urfave_cli_no_docs
- run: make test
- run: make -C cmd/urfave-cli-genflags
- run: make check-binary-size
2022-09-11 22:32:04 +00:00
env:
2022-09-11 22:34:13 +00:00
GFLAGS: -tags urfave_cli_no_docs
2022-09-11 22:32:04 +00:00
- run: make check-binary-size
- run: make yamlfmt
- run: make generate
- run: make diffcheck
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
run: make v2diff
- if: success() && matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
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
runs-on: ubuntu-latest
2019-12-25 17:10:48 +00:00
steps:
- uses: actions/setup-go@v3
2019-12-25 17:10:48 +00:00
with:
go-version: 1.19.x
- uses: actions/setup-node@v3
2020-01-13 05:27:42 +00:00
with:
node-version: '16'
- name: Set PATH
2022-09-11 20:37:56 +00:00
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
- uses: actions/checkout@v3
- run: make ensure-gfmrun
- run: make gfmrun
2022-09-11 22:32:04 +00:00
env:
2022-10-03 14:12:37 +00:00
FLAGS: --walk docs/v3/
- run: make diffcheck
2022-05-09 00:49:08 +00:00
publish:
permissions:
contents: write
# TODO: switch once v3 is released {{
# if: startswith(github.ref, 'refs/tags/')
if: 'false'
# }}
2022-05-09 00:49:08 +00:00
name: publish
needs: [test-docs]
2022-05-09 00:49:08 +00:00
runs-on: ubuntu-latest
steps:
- 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
- run: make set-mkdocs-remote
env:
MKDOCS_REMOTE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: make deploy-mkdocs