ci: Add a CI to check documentation changes #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is used to make sure that contributors did not forget to generate the documentations for the finch commands. | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'contrib/**' | |
- '.github/CODEOWNERS' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- 'contrib/**' | |
- '.github/CODEOWNERS' | |
jobs: | |
check-documentation-changes: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
# We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail. | |
fetch-depth: 0 | |
persist-credentials: false | |
submodules: recursive | |
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Clean up previous files | |
run: | | |
sudo rm -rf /opt/finch | |
sudo rm -rf ~/.finch | |
sudo rm -rf ./_output | |
if pgrep '^qemu-system'; then | |
sudo pkill '^qemu-system' | |
fi | |
if pgrep '^socket_vmnet'; then | |
sudo pkill '^socket_vmnet' | |
fi | |
- name: Install Rosetta 2 | |
run: echo "A" | softwareupdate --install-rosetta || true | |
- run: brew install lz4 automake autoconf libtool yq | |
shell: zsh {0} | |
- name: Build project | |
run: | | |
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" | |
make | |
shell: zsh {0} | |
- name: Generate docs | |
run: | | |
make gen-docs | |
shell: zsh {0} | |
- name: Check to generate docs | |
run: | | |
git add -N docs/cmd | |
git diff --exit-code docs/cmd |