|
| 1 | +name: Documentation CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +env: |
| 13 | + HOMEBREW_DEVELOPER: 1 |
| 14 | + HOMEBREW_NO_AUTO_UPDATE: 1 |
| 15 | + HOMEBREW_NO_ENV_HINTS: 1 |
| 16 | + HOMEBREW_BOOTSNAP: 1 |
| 17 | + HOMEBREW_NO_INSTALL_CLEANUP: 1 |
| 18 | + |
| 19 | +jobs: |
| 20 | + docs: |
| 21 | + runs-on: ubuntu-22.04 |
| 22 | + steps: |
| 23 | + - name: Set up Homebrew |
| 24 | + id: set-up-homebrew |
| 25 | + uses: Homebrew/actions/setup-homebrew@master |
| 26 | + with: |
| 27 | + core: false |
| 28 | + cask: false |
| 29 | + test-bot: false |
| 30 | + |
| 31 | + - name: Checkout repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + - name: Install vale |
| 35 | + run: brew install vale |
| 36 | + |
| 37 | + - name: Cleanup Homebrew/brew docs |
| 38 | + if: github.repository == 'Homebrew/brew' |
| 39 | + run: | |
| 40 | + set -xeuo pipefail |
| 41 | +
|
| 42 | + # Avoid failing on broken symlinks. |
| 43 | + rm Library/Homebrew/os/mac/pkgconfig/fuse/fuse.pc |
| 44 | + rm Library/Homebrew/os/mac/pkgconfig/fuse/osxfuse.pc |
| 45 | +
|
| 46 | + # No ignore support (https://github.com/errata-ai/vale/issues/131). |
| 47 | + rm -r Library/Homebrew/vendor |
| 48 | +
|
| 49 | + - name: Run Vale |
| 50 | + run: vale docs/ |
| 51 | + |
| 52 | + - name: Install Ruby |
| 53 | + uses: ruby/setup-ruby@78c01b705fd9d5ad960d432d3a0cfa341d50e410 # v1.179.1 |
| 54 | + with: |
| 55 | + bundler-cache: true |
| 56 | + working-directory: docs |
| 57 | + |
| 58 | + - name: Check Markdown syntax |
| 59 | + working-directory: docs |
| 60 | + run: bundle exec rake lint |
| 61 | + |
| 62 | + - name: Check code blocks conform to our Ruby style guide |
| 63 | + run: brew style docs |
| 64 | + |
| 65 | + - name: Generate formulae.brew.sh API samples |
| 66 | + if: github.repository == 'Homebrew/formulae.brew.sh' |
| 67 | + working-directory: docs |
| 68 | + run: ../script/generate-api-samples.rb |
| 69 | + |
| 70 | + - name: Build the site and check for broken links |
| 71 | + working-directory: docs |
| 72 | + run: bundle exec rake test |
| 73 | + env: |
| 74 | + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments