Skip to content

Migrate CI to GitHub Actions #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 24, 2019
Merged

Conversation

alexcrichton
Copy link
Member

This involves less secret and user management than azure pipelines, has
more concurrency by default for repos, and in general has a bit more
modern syntax!

@rust-highfive
Copy link

r? @gnzlbg

(rust_highfive has picked a reviewer for you, use r? to override)

This involves less secret and user management than azure pipelines, has
more concurrency by default for repos, and in general has a bit more
modern syntax!
Copy link
Member Author

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naturally isn't hooked up yet to bors and at this point I don't believe that anyone's hooked up a github actions check to bors yet. If this needs to be hooked up to bors then that will take some more investigation.

git init
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implicitly set by GitHub Actions, so no need to out of our way to set extra tokens and whatnot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, wow, this is great!

name: Test
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put everything into the same matrix here, and I did away with the stage0/stage1 tests to instead just limit the concurrency, which I believe achieves the same goal as before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency limit was there because of cross-repo queues, but IIUC github actions has a per-repo queue with a per-repo limit right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure about the queueing algorithm of github actions, and I suspect that it's still in flux. I believe it's per repo though yeah now that you mention this, so I can certainly remove this. Worth mentioning if it's needed in the future though!

# macOS targets
- x86_64-apple-darwin
# FIXME: gh-actions build environment doesn't have linker support
# - i686-apple-darwin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of using macos-latest there is a slightly older image that one can use ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately there's only one image right now (aliased as macos-latest) and it doesn't have support for i686-apple-darwin, but I don't think i686-apple-darwin is covering much that i686-unknown-linux-gnu isn't already covering.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason the latest image doesn't support it is because the target is deprecated, so...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah at some point we're gonna need to start talking in rust-lang/rust about dropping the target, but that's still a bit down the road!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait I was wrong. MacOSX 10.13 deprecated the target, and now it is removed in 10.14, and 10.15 is in beta.. As long Azure or Travis offer VMs with MacOSX <= 10.13 rust-lang/rust can produce binaries for it, but it wouldn't surprise me if github actions doesn't add VMs for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True yeah, at this time Github Actions only supports 10.14 and doesn't have old enough Xcode sdks to target i686-apple-darwing (or at least not that I've been able to figure out). GitHub Actions is still somewhat in flux though, so you're right that they may eventually add support

steps:
- uses: actions/checkout@master
- name: Install Rust (rustup)
run: rustup update nightly --no-self-update && rustup default nightly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is --no-self-update required on github actions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it is for now on Windows yeah. The windows environment has permissions such that you can't self-update the rustup.exe executable. They're purportedly working on fixing it, but it's not fixed yet :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Azure had the same issue :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it's worth pointing out that azure pipelines and github actions share most of their infrastructure, so limitations in one tend to be in the other as well...

Copy link
Contributor

@gnzlbg gnzlbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this LGTM. Feel free to merge once you think its ready. About bors, its going to have to support this sooner or later, but I think its ok to just manually merge PRs here until it gains support. So I wouldn't block landing this on that.

Looks like it's got quite a few errors
@alexcrichton alexcrichton merged commit 53a7e00 into rust-lang:master Sep 24, 2019
@alexcrichton alexcrichton deleted the gh-actions branch September 24, 2019 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants