about summary refs log tree commit diff
path: root/src/ci/github-actions
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2023-06-07 19:20:39 -0400
committerTrevor Gross <tgross@intrepidcs.com>2023-06-12 17:31:20 -0400
commit696b0dd472d42c7e71c992bd2e3def2d40fadebb (patch)
treefda72296f6b5e1b778adc948ca9ce38b55e536bf /src/ci/github-actions
parentdf77afbcaf3365a32066a8ca4a00ae6fc9a69647 (diff)
downloadrust-696b0dd472d42c7e71c992bd2e3def2d40fadebb.tar.gz
rust-696b0dd472d42c7e71c992bd2e3def2d40fadebb.zip
Publish docs as github artifacts during CI
This PR saves library docs as github artifacts so they can be easily
viewed for review.

Discussed in <https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Building.20docs.20for.20PR.20CI>
Diffstat (limited to 'src/ci/github-actions')
-rw-r--r--src/ci/github-actions/ci.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index d3cb6b6ed52..f8986bbc108 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -34,6 +34,8 @@ x--expand-yaml-anchors--remove:
   - &shared-ci-variables
     CI_JOB_NAME: ${{ matrix.name }}
     CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
+    # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
+    HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
 
   - &public-variables
     SCCACHE_BUCKET: rust-lang-ci-sccache2
@@ -229,6 +231,20 @@ x--expand-yaml-anchors--remove:
           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
         <<: *step
 
+      - name: create github artifacts
+        run: src/ci/scripts/create-doc-artifacts.sh
+        <<: *step
+
+      - name: upload artifacts to github
+        uses: actions/upload-artifact@v3
+        with:
+          # name is set in previous step
+          name: ${{ env.DOC_ARTIFACT_NAME }}
+          path: obj/artifacts/doc
+          if-no-files-found: ignore
+          retention-days: 5
+        <<: *step
+
       - name: upload artifacts to S3
         run: src/ci/scripts/upload-artifacts.sh
         env: