refactor(build): make cargotiming to build and test for workspace #3311
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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| name: book | |
| env: | |
| CDN: https://dnglbrstg7yg.cloudfront.net | |
| CI_ARTIFACTS_BUCKET: s2n-quic-ci-artifacts | |
| # By default depandabot only receives read permissions. Explicitly give it write | |
| # permissions which is needed by the ouzi-dev/commit-status-updater task. | |
| # | |
| # Updating status is relatively safe (doesnt modify source code) and caution | |
| # should we taken before adding more permissions. | |
| permissions: | |
| contents: write | |
| statuses: write | |
| id-token: write # This is required for requesting the JWT/OIDC | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Set override | |
| run: rustup override set stable | |
| - uses: camshaft/install@v1 | |
| with: | |
| crate: mdbook | |
| - name: Build book | |
| run: ./scripts/book | |
| - name: Deploy | |
| uses: JamesIves/github-pages-deploy-action@v4.6.3 | |
| if: github.event_name == 'push' | |
| with: | |
| folder: target/book | |
| - uses: aws-actions/configure-aws-credentials@v5.1.1 | |
| if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name | |
| with: | |
| role-to-assume: arn:aws:iam::024603541914:role/GitHubOIDCRole | |
| role-session-name: S2nQuicGHAS3Session | |
| aws-region: us-west-2 | |
| - name: Upload to S3 | |
| if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name | |
| id: s3 | |
| run: | | |
| TARGET_SHA="${{ github.sha }}/book" | |
| aws s3 sync target/book "s3://${{ env.CI_ARTIFACTS_BUCKET }}/$TARGET_SHA" --acl private --follow-symlinks | |
| URL="$CDN/$TARGET_SHA/index.html" | |
| echo "URL=$URL" >> $GITHUB_OUTPUT | |
| # Only upload to latest if the event is push to main | |
| if [ "${{ github.event_name }}" == "push" ]; then | |
| TARGET_LATEST="latest/book" | |
| aws s3 cp "s3://${{ env.CI_ARTIFACTS_BUCKET }}/$TARGET_SHA" "s3://${{ env.CI_ARTIFACTS_BUCKET }}/$TARGET_LATEST" --recursive | |
| fi | |
| - uses: ouzi-dev/commit-status-updater@v2.0.2 | |
| if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name | |
| with: | |
| name: "book / url" | |
| status: "success" | |
| url: "${{ steps.s3.outputs.URL }}" |