src/doc/rustc-dev-guide/.github/workflows/ci.yml YAML 91 lines View on github.com → Search inside
1name: CI23on:4  push:5    branches:6      - main7  pull_request:8  schedule:9    # Run multiple times a day as the successfull cached links are not checked every time.10    - cron: "0 */8 * * *"1112jobs:13  ci:14    if: github.repository == 'rust-lang/rustc-dev-guide'15    runs-on: ubuntu-latest16    env:17      MDBOOK_VERSION: 0.5.218      MDBOOK_LINKCHECK2_VERSION: 0.11.019      MDBOOK_MERMAID_VERSION: 0.17.020      MDBOOK_OUTPUT__LINKCHECK__FOLLOW_WEB_LINKS: ${{ github.event_name != 'pull_request' }}21      DEPLOY_DIR: book/html22      BASE_SHA: ${{ github.event.pull_request.base.sha }}23      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}24    steps:25      - uses: actions/checkout@v526        with:27          # linkcheck needs the base commit.28          fetch-depth: 02930      - name: Cache binaries31        id: mdbook-cache32        uses: actions/cache@v433        with:34          path: |35            ~/.cargo/bin36          key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }}3738      - name: Restore cached Linkcheck39        if: github.event_name == 'schedule'40        id: cache-linkcheck-restore41        uses: actions/cache/restore@v442        with:43          path: book/linkcheck/cache.json44          key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}45          restore-keys: |46            linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--4748      - name: Install latest nightly Rust toolchain49        if: steps.mdbook-cache.outputs.cache-hit != 'true'50        run: |51          rustup update nightly52          rustup override set nightly5354      - name: Install Dependencies55        if: steps.mdbook-cache.outputs.cache-hit != 'true'56        run: |57          cargo install mdbook --version ${{ env.MDBOOK_VERSION }}58          cargo install mdbook-linkcheck2 --version ${{ env.MDBOOK_LINKCHECK2_VERSION }}59          cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}6061      - name: Check build62        run: ENABLE_LINKCHECK=1 mdbook build6364      - name: Save cached Linkcheck65        id: cache-linkcheck-save66        if: ${{ !cancelled() && github.event_name == 'schedule' }}67        uses: actions/cache/save@v468        with:69          path: book/linkcheck/cache.json70          key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }}7172      - name: Deploy to gh-pages73        if: github.event_name == 'push'74        run: |75          touch "${{ env.DEPLOY_DIR }}/.nojekyll"76          cp CNAME "${{ env.DEPLOY_DIR }}"77          cd "${{ env.DEPLOY_DIR }}"78          rm -rf .git79          git init80          git config user.name "Deploy from CI"81          git config user.email ""82          git add .83          git commit -m "Deploy ${GITHUB_SHA} to gh-pages"84          git push --quiet -f "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}" HEAD:gh-pages8586      - name: Check if files comply with semantic line breaks87        continue-on-error: true88        run: |89          # using split_inclusive that uses regex feature that uses an unstable feature90          RUSTC_BOOTSTRAP=1 cargo run --release --manifest-path ci/sembr/Cargo.toml src

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.