From f54464dcdd46b37b15f84573b027d05453e68021 Mon Sep 17 00:00:00 2001 From: Tiziano Santoro Date: Mon, 20 Apr 2020 19:04:54 +0100 Subject: [PATCH] Make rust doc deterministic Avoid committing if there is no change compared to the previous version, to keep history clean. Ref #246 --- .github/workflows/build_rust_docs.yaml | 1 + scripts/build_gh_pages | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build_rust_docs.yaml b/.github/workflows/build_rust_docs.yaml index aa517a6b44d..712ae316ced 100644 --- a/.github/workflows/build_rust_docs.yaml +++ b/.github/workflows/build_rust_docs.yaml @@ -58,5 +58,6 @@ jobs: run: | cd ./out git add . + [[ -z "$(git status --porcelain)" ]] && (echo 'no changes to commit'; exit 0) git commit --message="Update gh-pages from ${GITHUB_SHA}" git push diff --git a/scripts/build_gh_pages b/scripts/build_gh_pages index d31042f45c9..7e15607568f 100755 --- a/scripts/build_gh_pages +++ b/scripts/build_gh_pages @@ -35,6 +35,9 @@ cargo doc --no-deps --target-dir="${TARGET_DIR}" # Remove non-doc artifacts from the target dir. rm --recursive --force "${TARGET_DIR}/debug" +# Remove non-deterministic files. +rm "{TARGET_DIR}/.rustc_info.json" + # The docs generated from the Cargo workspace do not include a workspace-level index, so we generate # one here and redirect to the Oak SDK documentation. cat <<-END > "${TARGET_DIR}/index.html"