Skip to content
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

Add test for precompiled binary failing on Windows to CI #389

Merged
merged 8 commits into from
Feb 25, 2023

Conversation

mgr0dzicki
Copy link
Collaborator

This exposes the issue encountered while testing the new GitHub Action on Windows machine (see current workaround obi1kenobi/cargo-semver-checks-action@2d4767c).

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Nice find! I opened an issue upstream, and we can work on merging this PR as well.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Comment on lines 959 to 972
- name: Baseline is correct
run: |
$EXPECTED = " Parsing ref_slice v1.2.2 (current)`r`n Parsing ref_slice v1.2.1 (baseline)`r`n Checking ref_slice v1.2.1 -> v1.2.2 (patch change)"
# Strip ANSI escapes for colors and bold text before comparing.
$RESULT = (cat output | grep 'ref_slice v1.' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g") | Out-String
compare $RESULT $EXPECTED

- name: Semver break found
run: |
$EXPECTED = "--- failure function_missing: pub fn removed or renamed ---"
$RESULT = (cat output | grep failure)
compare $RESULT $EXPECTED
# Ensure the following fragment (not full line!) is in the output file:
grep ' function ref_slice::ref_slice, previously in file' output
Copy link
Owner

Choose a reason for hiding this comment

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

I added caching for baseline rustdoc JSON files in the other jobs -- would you mind adding it here too? You'll need to amend the top EXPECTED variable since right now it effectively asserts that caching isn't used (Parsing ref_slice v1.2.1 (baseline), not (baseline, cached)), and add the new caching steps as in the other jobs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added caching, but also extracted building the Windows binary to a separate job as you did with the one for Ubuntu. I think it makes it a little cleaner and we don't have to manually remove the index directory if we restore the cached binary instead of building it. What is your opinion?

One may ask why I created a separate build-binary-windows job instead of using matrix strategy for the existing one. The main reason is that building the tool on Windows appears to be much slower, and if we use matrix strategy, there is currently no way for other jobs to depend only on the ubuntu case, which makes the whole CI last longer...

Copy link
Owner

Choose a reason for hiding this comment

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

The explanation here is great, but once this PR merges, we probably won't remember why the jobs are separate. We might even merge them together into a matrix, even though you clearly point out how that isn't the right thing to do.

Consider adding this as a comment in the CI file, where it will be harder to miss?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea! Added in #407

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Minor concern about the path separators since I don't know how GitHub Actions works on Windows. But overall this looks great and I'm happy to merge it once you've had a look at the comment and fixed up the CI failure.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@obi1kenobi
Copy link
Owner

Upgrading to crates-index v0.19.6 should fix the problem: frewsxcv/rust-crates-index@0.19.5...0.19.6

@mgr0dzicki
Copy link
Collaborator Author

I think it's ready to go now! :)

@obi1kenobi obi1kenobi merged commit 37568fc into obi1kenobi:main Feb 25, 2023
@mgr0dzicki mgr0dzicki deleted the windows_failing_ci branch February 26, 2023 10:31
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.

2 participants