-
Notifications
You must be signed in to change notification settings - Fork 24
Update Github Actions for Windows #34
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
Conversation
Thanks for your efforts on this one. I have two comments: 1. I'm not a big fan of breaking the windows builds into two separate runs because most of their time is spent setting up the R and Rust environments, so there's a lot of wasted compute. I know we get the GH Action hours for free but we should still be cognizant of resource use. 2. The action scripts need to be completely reworked along the lines of the extendr scripts so we can target specific R versions: It may make sense to put everything into one single matrix or to have two matrices, one for unix-like builds and one for windows builds. Not sure about that one, depends on how much special casing is needed. If you'd like to take a stab at this, you're welcome to do so. |
To be clear: It's the following part of the extendr test script that would make a good starting point for libR-sys: |
@clauswilke , I can try to rewrite script following |
So this is a template for a new GH Actions script, inspired by |
To make tests work on r-devel you need to set For the artifacts, there's nothing to worry about, generating and saving the artifacts costs practically nothing. I think it's good to have artifacts for all settings we test. This allows us to check whether anything changes, e.g., whether bindings under |
.github/workflows/test.yml
Outdated
uses: actions/upload-artifact@main | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- name: Set up `rust` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be Rust
instead of `rust`
. In general, I think names of programming languages should not be set in backticks, but more specifically here I don't think the backticks are converted into code font.
.github/workflows/test.yml
Outdated
- uses: actions/checkout@v2 | ||
- uses: msys2/setup-msys2@v2 | ||
# This step is only needed for Windows | ||
- name: Set up `msys2` for Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would similarly delete backticks here.
.github/workflows/test.yml
Outdated
|
||
# Run tests again using different bindings | ||
- name: Run tests on precomputed bindings shipped with libR-sys | ||
run: cargo test -vv $env:CARGO_BUILD_FLAGS -- --nocapture --test-threads=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline at the end of the file.
I noticed I screwed up with |
Debugging GitHub actions is a real pain. Should I squash commits? GHA requires a lot of small commits to fine-tune the script, unfortunately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Just a few remaining items while you're at it.
Don't worry about squashing the commits, GitHub does that automatically when merging.
.github/workflows/test.yml
Outdated
- {os: ubuntu-20.04, r: 'release', rust-version: 'stable', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
- {os: ubuntu-20.04, r: 'release', rust-version: 'nightly', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
# R-devel requires LD_LIBRARY_PATH | ||
- {os: ubuntu-20.04, r: 'devel', rust-version: 'nightly', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think R devel should be tested with rust stable, so if something breaks we know whether it's R devel or rust nightly that is the problem. Also, could you expand the matrix so there is an R oldrel
run for each OS/architecture? I'd like to have bindings for those versions as well (I realize this will break the test of precompiled bindings; don't worry about that or download the artifacts and add them, as you wish).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we now test three versions of R for each architecture. I also added R-release rust-nightly generating no bindings to test rust features.
Actually, you were wrong about tests -- you (or someone else) implemented a fallback to default bindings if the exact version is missing, so tests were successful (and a warning was logged). I downloaded new bindings, now we have fallback, 4.0 release, 4.1 devel, and 3.6 oldrel versions for each target.
.github/workflows/test.yml
Outdated
uses: actions/upload-artifact@main | ||
with: | ||
name: Windows generated bindings | ||
name: ${{ matrix.config.os }} ${{ matrix.config.rust-version }} generated bindings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated bindings need to have the R version in the name also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Artifact names are now identical to job names
You're correct. I added the fallback if bindings are missing. Thanks! |
* Split Windows jobs in two * Setting up GH actions environment * Fixing indentation * Fixing indentation #2 * Testing environment * Fixe incorrect rustup command * Checking CARGO_BUILD_FLAGS * Running test build * Probing environment * Testing new build * Fixing GITHUB_ENV/GITHUB_PATH * Enabling tests * Enabling macOS * Enabling tests of precomputed bindings * Exporting bindings on success * Checking Windows paths * Trying Win-i686 build * Temporary disable ubuntu::r-devel * Comment * Upload bindings if both build and test succeed * Added RSPM * Disabled ubuntu::r-devel; generate bindings only for stable rust * Removed old code * Fixed rust version comparison string * Testing 'if:' condition * Fixed config * Testing ubuntu::r-devel * Bypassing R alias * Debugging environment * Cleaning * Removed unused R_HOME * Changed generated bindings name * Adding Windows/MacOS workflows * New bindings for Windows/MacOS * Adding Ubuntu jobs * Bindings for Linux
Using insights from #9 we can now more or less reliably generate bindings for both 32- and 64-bit Windows.
With the path trick discussed in #29
i386/i686
tests can be run (though most of the tests are disabled).I suggest to split Windows job into two separate ones and build bindings separately for each architecture.
I am not sure if I correctly copied the binding upload process, this should be checked.