metrics-cache parse_quantity: add tests #101
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: Docs | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| # Allow the deploy job to publish to GitHub Pages via OIDC. | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Never run two Pages deployments concurrently, but let an in-flight one finish. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| # .cargo/config.toml pins build.target to musl, so cargo doc emits its | |
| # output under this target-specific directory, not plain target/doc. | |
| DOC_DIR: target/x86_64-unknown-linux-musl/doc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: x86_64-unknown-linux-musl | |
| - name: Install musl C toolchain | |
| # cargo doc still *compiles* deps (running their build scripts) to | |
| # document our crates. ring's build script needs the musl C compiler | |
| # for the musl target, even though no final binary is linked. | |
| run: sudo apt update && sudo apt install -y musl-tools | |
| - name: Build rustdoc | |
| # --workspace: document all member crates (lib, metrics-cache, metrics-fetcher) | |
| # --no-deps: skip third-party deps, only our own crates | |
| # --document-private-items: this is an internal maintenance doc site | |
| run: cargo doc --workspace --no-deps --document-private-items | |
| - name: Redirect root to the metrics-cache crate | |
| # cargo doc produces no top-level index.html for a workspace, so point | |
| # the Pages root at the primary crate (hyphen -> underscore in the path). | |
| run: echo '<meta http-equiv="refresh" content="0; url=metrics_cache/index.html">' > "$DOC_DIR/index.html" | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ${{ env.DOC_DIR }} | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| # The Pages deployment service flakes fairly regularly ("Deployment | |
| # failed, try again later" after a successful build). Retry once, and | |
| # never fail the workflow over it: the docs BUILD failing is signal, | |
| # the deploy hiccuping is GitHub weather. | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 | |
| continue-on-error: true | |
| - id: deployment-retry | |
| if: steps.deployment.outcome == 'failure' | |
| uses: actions/deploy-pages@v4 | |
| continue-on-error: true | |
| - if: steps.deployment.outcome == 'failure' && steps.deployment-retry.outcome == 'failure' | |
| run: echo "::warning::Pages deployment failed twice; docs were built but not published this run." |