ci: Add format-code-sample-tabs to CI format workflow #3542
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: Generate | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| workflow_dispatch: {} | |
| jobs: | |
| commit: | |
| name: Generate code | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_committer_name: ${{ secrets.GIT_USER_NAME }} | |
| git_committer_email: ${{ secrets.GIT_USER_EMAIL }} | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| install_dependencies: 'false' | |
| - name: Install ruff | |
| run: | | |
| curl -LsSf https://astral.sh/ruff/0.6.3/install.sh | sh | |
| echo "$HOME/.cargo/env" >> $GITHUB_PATH | |
| - name: Install shfmt | |
| run: | | |
| wget https://github.com/mvdan/sh/releases/download/v3.9.0/shfmt_v3.9.0_linux_amd64 -O shfmt | |
| chmod a+x shfmt | |
| mv shfmt /usr/local/bin/shfmt | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '^1.23.2' | |
| - name: Install syntax_tree | |
| run: gem install syntax_tree -v 6.2.0 | |
| - name: Normalize package-lock.json | |
| run: npm install | |
| - name: Generate docs | |
| uses: nick-fields/retry@v3 | |
| with: | |
| max_attempts: 3 | |
| retry_wait_seconds: 1 | |
| timeout_minutes: 2 | |
| command: npm run generate | |
| - name: Commit | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: 'ci: Generate docs' | |
| commit_user_name: ${{ secrets.GIT_USER_NAME }} | |
| commit_user_email: ${{ secrets.GIT_USER_EMAIL }} | |
| commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}> | |
| validate: | |
| name: Validate paths and links | |
| needs: commit | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Validate SUMMARY.md paths | |
| run: npm run validate-paths | |
| - name: Validate cross-site links | |
| run: npm run validate-links | |
| - name: Validate all pages are in SUMMARY.md | |
| run: npm run validate-orphan-pages | |
| - name: Validate redirect targets | |
| run: npm run validate-redirects |