Skip to content

Commit

Permalink
Make rust doc deterministic
Browse files Browse the repository at this point in the history
Avoid committing if there is no change compared to the previous version,
to keep history clean.

Ref project-oak#246
  • Loading branch information
tiziano88 committed Apr 20, 2020
1 parent bc98624 commit a82d6d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build_rust_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ jobs:
# From the "out" folder, commit the results and push to gh-pages.
# This step only applies to `push` events (not `pull_request`).
- name: Commit and push (post-merge only)
if: github.event_name == 'push'
# if: github.event_name == 'push'
run: |
cd ./out
git add .
git commit --message="Update gh-pages from ${GITHUB_SHA}"
git push
if [[ -n "$(git status --porcelain)" ]]; then
# git commit --message="Update gh-pages from ${GITHUB_SHA}"
# git push
echo 'yes changes'
else
echo 'no changes to commit'
fi
3 changes: 3 additions & 0 deletions scripts/build_gh_pages
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a82d6d1

Please sign in to comment.