Skip to content

Commit 13417d9

Browse files
bors[bot]Bromeon
andauthored
Merge #877
877: Doc CI on unchanged code + minimal dependency tweak r=Bromeon a=Bromeon **Doc CI** Many times, the `doc` CI job failed, since there was no actual diff in generated documentation. This caused `git commit` to return an error status, failing the entire job. This PR addresses this. **Minimal dependency versions** Apparently, `miniserde` versions 0.1.10..=0.1.15 work for rustc 1.59.0, but not for older rustc versions. Our CI only checks the stable channel with `cargo +nightly update -Z minimal-versions`, so this was not caught. For the moment, no new CI job is added (to keep minimal dependencies and minimal rustc as orthogonal as possible). Changing the "minimal dependencies" job to also use MSRV would be an option, but that would make it less easy to see whether a job fails due to rustc or dependency versions. bors r+ Co-authored-by: Jan Haller <bromeon@gmail.com>
2 parents 339d0dd + f274dd9 commit 13417d9

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.github/workflows/doc.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525

2626

2727
# In the very unlikely cases where two PRs are merged, and the first 'doc' job is still running when the 2nd 'full-ci' starts,
28-
# make sure the first one is awaited. Even though docs are eventually overwritten, this ensures continuitiy in the doc repo history.
28+
# make sure the first one is awaited. Even though docs are eventually overwritten, this ensures continuity in the doc repo history.
2929
concurrency:
3030
group: 'sync-doc'
3131
cancel-in-progress: false
@@ -58,6 +58,7 @@ jobs:
5858
# For email address, see https://github.community/t/github-actions-bot-email-address/17204
5959
# As search-index.js changes every time, even if source hasn't changed, this will not need 'git commit --allow-empty'
6060
- name: "Prepare upload"
61+
id: prepareUpload
6162
run: |
6263
mkdir ~/.ssh
6364
echo '${{ secrets.DOC_DEPLOY_SSH_KEY }}' > ~/.ssh/id_rsa
@@ -72,25 +73,32 @@ jobs:
7273
mv ${GITHUB_WORKSPACE}/target/doc/* .
7374
mv ${GITHUB_WORKSPACE}/.github/workflows/doc/* .
7475
75-
GDRUST_VERSION=$(grep -Po '^version = "\K[^"]*' ${GITHUB_WORKSPACE}/gdnative/Cargo.toml)
76-
GDRUST_SHORT_SHA=$(git rev-parse --short "${GITHUB_SHA}")
76+
libVersion=$(grep -Po '^version = "\K[^"]*' ${GITHUB_WORKSPACE}/gdnative/Cargo.toml)
77+
shortSha=$(git rev-parse --short "${GITHUB_SHA}")
7778
78-
find gdnative -name .html -o -type f -print0 | xargs -0 sed -i 's/'"${GDRUST_VERSION}"'/master/g'
79+
find gdnative -name .html -o -type f -print0 | xargs -0 sed -i 's/'"$libVersion"'/master/g'
7980
80-
git add --all
81-
git commit -m "Sync doc from ${GDRUST_SHORT_SHA}
82-
83-
Revision in godot-rust: ${GITHUB_SHA}"
81+
if git diff --exit-code
82+
then
83+
echo "$shortSha introduces no doc changes; skip commit and push."
84+
else
85+
git add --all
86+
git commit -m "Sync doc from $shortSha
87+
88+
Revision in godot-rust: ${GITHUB_SHA}"
89+
90+
echo ::set-output name=docsChanged::true
91+
fi
8492

8593
- name: "Upload"
8694
working-directory: doc
8795
run: git push origin ${GDRUST_DOC_BRANCH}
96+
if: ${{ steps.prepareUpload.outputs.docsChanged == 'true' }}
8897

8998
- name: "Cleanup"
9099
run: shred -u ~/.ssh/id_rsa
91100

92101

93-
94102
# Possible alternative: dispatching a remote workflow
95103

96104
# - name: 'Dispatch remote workflow'

bindings-generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ custom-godot = ["which"]
1818
[dependencies]
1919
heck = "0.4"
2020
memchr = "2"
21-
miniserde = "0.1.10"
21+
miniserde = "0.1.16"
2222
proc-macro2 = "1"
2323
quote = "1"
2424
regex = { version = "1.5.5", default-features = false, features = ["std"] } # for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html

gdnative-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ libc = "0.2"
1919
bindgen = { version = "0.59", default-features = false, features = ["runtime"] }
2020
proc-macro2 = "1"
2121
quote = "1"
22-
miniserde = "0.1.10"
22+
miniserde = "0.1.16"
2323
semver = "1"

0 commit comments

Comments
 (0)