Merge pull request #1292 from maximebuyse/fix/miri-sysroot-portability #554
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: Deploy Doc | |
| on: | |
| push: | |
| branches: [ main ] | |
| # Makes it possible to run the workflow by hand from GitHub's interface. | |
| workflow_dispatch: | |
| jobs: | |
| # Build job | |
| build: | |
| # Specify runner + build & upload the static files as an artifact | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build static files | |
| env: | |
| CARGO_TERM_COLOR: always | |
| run: | | |
| cd charon | |
| make doc | |
| - name: Install rustc internal docs | |
| run: | | |
| rustup toolchain list -v | |
| # Find toolchain path | |
| export TOOLCHAIN=$(rustc --print sysroot) | |
| echo "toolchain=\"$TOOLCHAIN\"" | |
| # Download rustc API docs | |
| rustup component add rustc-docs | |
| # Move the docs to deployment path | |
| mv $TOOLCHAIN/share/doc/rust/html/rustc-docs charon/target/doc/rustc | |
| - name: Prepare index.html | |
| run: | | |
| # Find toolchain name | |
| export toolchain=$(rustc --print sysroot | grep -oP "nightly-\d{4}-\d{2}-\d{2}") | |
| echo "toolchain=\"$toolchain\"" | |
| # Fill in toolchain placeholder in index.html | |
| sed "s/nightly-xxxx-xx-xx/$toolchain/" .github/index.html > charon/target/doc/index.html | |
| - name: Include benchmark dashboard from bench-reports | |
| run: | | |
| # Fetch the benchmark data that the bench workflow pushes to bench-reports. | |
| if git fetch origin bench-reports 2>/dev/null; then | |
| git checkout origin/bench-reports -- bench/ 2>/dev/null && \ | |
| mv bench/ charon/target/doc/bench/ && \ | |
| cp .github/bench-index.html charon/target/doc/bench/index.html || \ | |
| echo "No benchmark data on bench-reports yet, skipping." | |
| else | |
| echo "No bench-reports branch yet, skipping benchmark dashboard." | |
| fi | |
| - name: Upload static files as artifact | |
| uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action | |
| with: | |
| path: charon/target/doc/ | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |