Switch from Travis to GHA#1073
Conversation
| cargo install mdbook --version ${{ env.MDBOOK_VERSION }} | ||
| cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} | ||
| cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }} |
There was a problem hiding this comment.
I haven't come up with a good way to use --version ^x.y.z while using actions/cache.
There was a problem hiding this comment.
I guess that means we'll have to manually update these tools more often?
There was a problem hiding this comment.
Is it worth it to introduce some automation to update those dependencies?
There was a problem hiding this comment.
Well, I guess we might be able to get dependabot setup, but I'm not sure if it's worth doing it here.
There was a problem hiding this comment.
AFAIK dependabot only updates Cargo.toml or Cargo.lock so it doesn't help us. But an automation job or something else would be great as follow-up work.
I guess that means we'll have to manually update these tools more often?
Yes, we can still use --version ^x.y.z specifying but it doesn't update the mdbook and their tools version due to the cache key.
.github/workflows/ci.yml
Outdated
| git switch -c ci | ||
| git fetch origin master | ||
| git rebase origin/master | ||
| git log --oneline | head -n 10 |
There was a problem hiding this comment.
Why does this rebase over master? Doesn't github do that automatically? What happens on merge conflicts?
There was a problem hiding this comment.
I just copy-pasted from the travis script, this is no longer required now?
There was a problem hiding this comment.
(IIRC we introduced it to avoid broken link failures that are already fixed on master.)
There was a problem hiding this comment.
I know that rust-lang/rust runs CI after rebasing against master; I don't think they do that explicitly and github handles it automatically. Not sure though.
There was a problem hiding this comment.
That sounds surprising to me, but a quick search for 'rebase' in rust's src/ci found no result. 🤷♂️
There was a problem hiding this comment.
IIRC this was introduced when we did huge refactorings on librustc, which causes a ton of link failures. Now the broken rate is low, so we could remove rebasing, I think.
|
Personally I think this is good as is and we can fix any bugs as they arise :) maybe @spastorino or @LeSeulArtichaut want to take a look though? |
| schedule: | ||
| # Run at 18:00 UTC every day | ||
| - cron: '0 18 * * *' |
There was a problem hiding this comment.
From what I understand, all the steps in the file are executed when master or a PR is pushed to, and at a regular interval (cron job). Is that correct?
There was a problem hiding this comment.
I think you're partially correct, but there are several instances of #1073 (comment).
There was a problem hiding this comment.
Is there a reason to not have this in a separate yml file inside of workflows?
There was a problem hiding this comment.
Is there a reason to not have this in a separate yml file inside of workflows?
I don't think it's worth having duplicate workflows with multiple files.
| cargo install mdbook --version ${{ env.MDBOOK_VERSION }} | ||
| cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} | ||
| cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }} |
There was a problem hiding this comment.
I guess that means we'll have to manually update these tools more often?
| key: ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }} | ||
|
|
||
| - name: Check line lengths | ||
| if: github.event_name != 'push' |
There was a problem hiding this comment.
I'm not sure we should block the deployment by the line length failure. It will be caught by the cron job anyway.
There was a problem hiding this comment.
Will the line-length check run for PRs? I was confused about whether push was just for pushes to master, or if it included PR pushes as well.
There was a problem hiding this comment.
Will the line-length check run for PRs? I was confused about whether push was just for pushes to master, or if it included PR pushes as well.
push here means just for master as we restrict it here: https://github.com/JohnTitor/rustc-dev-guide/blob/4c70da4512e1019a4deb0de9160791965b73a6a8/.github/workflows/ci.yml#L4-L6
For instance, I pushed this branch but the workflow wasn't triggered.
https://github.com/JohnTitor/rustc-dev-guide/tree/doesnt-trigger-event
| cargo install mdbook --version ${{ env.MDBOOK_VERSION }} | ||
| cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} | ||
| cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }} |
There was a problem hiding this comment.
Is it worth it to introduce some automation to update those dependencies?
|
Mhh, btw we won't be able to merge this without disabling the required CI pass from Travis. Is this waiting on something else? |
There should not be any blocker on this PR, I think. But yeah, we have to tweak the required status. |
|
I'll need to figure out how to merge - it looks like GitHub is not seeing the CI/ci workflow yet, maybe it needs to run on a non-PR first. I think maybe the easiest thing is to just override the protections, merge into master, and then go back and try and configure things. |
|
👍 overriding the protections seems good to me |
|
Updated the requirements. |
Update books ## nomicon 1 commits in adca786547d08fe676b2fc7a6f08c2ed5280ca38..6fe476943afd53a9a6e91f38a6ea7bb48811d8ff 2021-02-16 16:34:20 +0900 to 2021-03-10 07:28:57 +0900 - Merge pull request rust-lang/nomicon#257 from skade/opaque-types-fix ## reference 3 commits in 3b6fe80c205d2a2b5dc8a276192bbce9eeb9e9cf..e32a2f928f8b78d534bca2b9e7736413314dc556 2021-02-22 22:09:17 -0800 to 2021-03-08 23:24:30 -0800 - Clarify that ::foo paths are not necessarily based off of the "crate root" (rust-lang/reference#974) - Comment typo (rust-lang/reference#977) - Fix misspelled word discrimnant (rust-lang/reference#976) ## book 2 commits in 0f87daf683ae3de3cb725faecb11b7e7e89f0e5a..fc2f690fc16592abbead2360cfc0a42f5df78052 2021-03-01 08:54:04 -0500 to 2021-03-05 14:03:22 -0500 - Fix wrapping - fix: redundant double introduction of shadowing (rust-lang/book#2633) ## rust-by-example 1 commits in 3e0d98790c9126517fa1c604dc3678f396e92a27..eead22c6c030fa4f3a167d1798658c341199e2ae 2021-02-25 08:23:10 -0300 to 2021-03-04 16:26:43 -0300 - Fix grammar "terminates" -> "terminate" (rust-lang/rust-by-example#1423) ## rustc-dev-guide 15 commits in c431f8c..67ebd4b 2021-02-28 16:35:20 -0500 to 2021-03-11 13:36:25 -0800 - Remove extra the (rust-lang/rustc-dev-guide#1088) - Fix double-word typos (rust-lang/rustc-dev-guide#1084) - I-nominated are nominated for discussion (rust-lang/rustc-dev-guide#1080) - Complete unfinished statement - Check `BASE_SHA` only if it's a PR (rust-lang/rustc-dev-guide#1083) - Update lins - Apply suggestions from code review - Add stub about the THIR - Switch from Travis to GHA (rust-lang/rustc-dev-guide#1073) - Adjust a bit better P- label text - Fix typos (rust-lang/rustc-dev-guide#1079) - Update cmake version in prerequisites.md (rust-lang/rustc-dev-guide#1077) - Fix typo: suceed -> succeed - Add article on using WPA to profile rustc memory usage on Windows (rust-lang/rustc-dev-guide#1074) - Use more accurate estimate of generated LLVM IR with llvm-lines ## embedded-book 1 commits in a96d096cffe5fa2c84af1b4b61e1492f839bb2e1..f61685755fad7d3b88b4645adfbf461d500563a2 2021-02-17 08:08:52 +0000 to 2021-03-08 01:06:44 +0000 - Swap to GHA (rust-embedded/book#285)
Update books ## nomicon 1 commits in adca786547d08fe676b2fc7a6f08c2ed5280ca38..6fe476943afd53a9a6e91f38a6ea7bb48811d8ff 2021-02-16 16:34:20 +0900 to 2021-03-10 07:28:57 +0900 - Merge pull request rust-lang/nomicon#257 from skade/opaque-types-fix ## reference 3 commits in 3b6fe80c205d2a2b5dc8a276192bbce9eeb9e9cf..e32a2f928f8b78d534bca2b9e7736413314dc556 2021-02-22 22:09:17 -0800 to 2021-03-08 23:24:30 -0800 - Clarify that ::foo paths are not necessarily based off of the "crate root" (rust-lang/reference#974) - Comment typo (rust-lang/reference#977) - Fix misspelled word discrimnant (rust-lang/reference#976) ## book 2 commits in 0f87daf683ae3de3cb725faecb11b7e7e89f0e5a..fc2f690fc16592abbead2360cfc0a42f5df78052 2021-03-01 08:54:04 -0500 to 2021-03-05 14:03:22 -0500 - Fix wrapping - fix: redundant double introduction of shadowing (rust-lang/book#2633) ## rust-by-example 1 commits in 3e0d98790c9126517fa1c604dc3678f396e92a27..eead22c6c030fa4f3a167d1798658c341199e2ae 2021-02-25 08:23:10 -0300 to 2021-03-04 16:26:43 -0300 - Fix grammar "terminates" -> "terminate" (rust-lang/rust-by-example#1423) ## rustc-dev-guide 15 commits in c431f8c..67ebd4b 2021-02-28 16:35:20 -0500 to 2021-03-11 13:36:25 -0800 - Remove extra the (rust-lang/rustc-dev-guide#1088) - Fix double-word typos (rust-lang/rustc-dev-guide#1084) - I-nominated are nominated for discussion (rust-lang/rustc-dev-guide#1080) - Complete unfinished statement - Check `BASE_SHA` only if it's a PR (rust-lang/rustc-dev-guide#1083) - Update lins - Apply suggestions from code review - Add stub about the THIR - Switch from Travis to GHA (rust-lang/rustc-dev-guide#1073) - Adjust a bit better P- label text - Fix typos (rust-lang/rustc-dev-guide#1079) - Update cmake version in prerequisites.md (rust-lang/rustc-dev-guide#1077) - Fix typo: suceed -> succeed - Add article on using WPA to profile rustc memory usage on Windows (rust-lang/rustc-dev-guide#1074) - Use more accurate estimate of generated LLVM IR with llvm-lines ## embedded-book 1 commits in a96d096cffe5fa2c84af1b4b61e1492f839bb2e1..f61685755fad7d3b88b4645adfbf461d500563a2 2021-02-17 08:08:52 +0000 to 2021-03-08 01:06:44 +0000 - Swap to GHA (rust-embedded/book#285)

Fixes #940
Some scripts are taken from https://github.com/rust-lang/std-dev-guide and https://github.com/rust-lang/simpleinfra. Some actions log can be found here: https://github.com/JohnTitor/rustc-dev-guide/actions
TODO: We should also switch required status from Travis to GHA.