ci: add typo check to ci (#5491) #13180
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: s2n-tls Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| types: [checks_requested] | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pages: write | |
| jobs: | |
| typos: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Install rust toolchain | |
| id: toolchain | |
| run: | | |
| rustup toolchain install stable --profile minimal | |
| rustup override set stable | |
| - uses: camshaft/install@v1 | |
| with: | |
| crate: typos-cli | |
| bins: typos | |
| - name: Run typos | |
| run: | | |
| typos -c .github/config/typos.toml --format json | tee /tmp/typos.json | jq -rs '.[] | "::error file=\(.path),line=\(.line_num),col=\(.byte_offset)::\(.typo) should be \"" + (.corrections // [] | join("\" or \"") + "\"")' | |
| cat /tmp/typos.json | |
| ! grep -q '[^[:space:]]' /tmp/typos.json | |
| generate-doxygen: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Create Documentation | |
| run: | | |
| .github/s2n_doxygen.sh | |
| - name: Upload documentation to action | |
| # Upload the doxygen artifacts on pull requests to help reviewers easily | |
| # view changes. | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: s2n-tls-doxygen | |
| path: | | |
| docs/doxygen/output | |
| - name: Deploy documentation to gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| destination_dir: ./doxygen | |
| publish_dir: ./docs/doxygen/output/html | |