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

Github Actions #26

Merged
merged 2 commits into from
Dec 4, 2023
Merged

Github Actions #26

merged 2 commits into from
Dec 4, 2023

Conversation

amika-sq
Copy link
Contributor

@amika-sq amika-sq commented Dec 1, 2023

Add Github actions to do the following:

There were formatting issues in the repo, so I went ahead and ran the formatter and committed the fixes!

@amika-sq amika-sq changed the title Github action to run workspace tests Github Actions Dec 1, 2023
@TBD54566975 TBD54566975 deleted a comment from github-actions bot Dec 1, 2023
@amika-sq amika-sq marked this pull request as ready for review December 1, 2023 23:29
@amika-sq amika-sq requested a review from diehuxx December 1, 2023 23:29
name: cargo test
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
Copy link
Contributor

Choose a reason for hiding this comment

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

We haven't really targeted windows in other repos. It also turns out to be pretty slow. Do you think it's worth adding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-12-01 at 4 52 57 PM

Currently only take a few seconds longer than macos, so figured it would be fine to have. I'm fine removing though if people don't think it's worth it.

Copy link
Member

Choose a reason for hiding this comment

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

We are running Windows for Bundler Bonanza Electron apps: https://github.com/TBD54566975/bundler-bonanza/blob/main/.github/workflows/tests-runner.yml#L241

Rationale: anticipating build issues for windows developers...

strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
rust: [stable, nightly]
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why you chose the nightly build? What do you think about removing? It would cut the testing by half :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every six weeks, nightly is brought into a beta. Then six weeks after the first beta is released, a new stable release is made: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html

I'm not opposed to removing, but I have heard that open source developers may be more inclined to use nightly for various reasons. Happy to remove though if we wanted to save resources.

Comment on lines +194 to +195
let deserialized_with_type: PresentationDefinition =
serde_json::from_str(&raw_string).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

rustfmt for the win! 💪

Comment on lines +28 to +29
- name: Test
run: cargo test --workspace
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's worth adding a cargo build to make sure our builds are passing as well? (Or is it embedded in the cargo test command already?)

Copy link
Contributor Author

@amika-sq amika-sq Dec 4, 2023

Choose a reason for hiding this comment

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

I went ahead and did a little digging here to find out the specifics:

  • cargo test will implicitly run cargo build, BUT it will also build code that is specifically marked with #[cfg(test)] or #[test] (in addition to actually running the tests themselves).

Our upcoming bindings code will rely on artifacts generated via cargo build, as we don't want to include test code as a part of our bindings. I'll go ahead and add this in as part of the bindings CI once we get there!

@amika-sq amika-sq merged commit a9d41fb into main Dec 4, 2023
7 checks passed
@amika-sq amika-sq deleted the test-workspace-action branch December 4, 2023 16:36
@amika-sq amika-sq mentioned this pull request Dec 4, 2023
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