Skip to content

Build and test in a matrix #286

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

wiktor-k
Copy link
Collaborator

No description provided.

@wiktor-k wiktor-k force-pushed the wiktor/add-matrix-tests branch 2 times, most recently from b3132ab to a8b6b8b Compare June 11, 2025 07:12
wiktor-k added 2 commits June 11, 2025 09:17
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
@Jakuje
Copy link
Collaborator

Jakuje commented Jun 11, 2025

To catch the #282, we would need to also run the tests on this target.

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
@wiktor-k wiktor-k force-pushed the wiktor/add-matrix-tests branch from a8b6b8b to e0c4cfc Compare June 11, 2025 10:53
wiktor-k added 2 commits June 11, 2025 13:06
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
@wiktor-k
Copy link
Collaborator Author

To catch the #282, we would need to also run the tests on this target.

In this case, to be precise we don't actually need to run tests we just need to compile them. cargo check ... --all-targets checks tests and examples too (see cargo targets) and IMO we were missing that.

I think we don't need to strictly cargo build since we throw away the artifacts so check is sufficient. Running the tests may also be a good idea (but separate from the check) although I'm not sure how does it work (I don't think it emulates, say, aarch64 to run the test).

I've updated the matrix job and it's clearly visible it's not just that particular 32bit target that was failing.

To be honest I'd move the ci.sh to yaml since it's pretty straightforward and GitHub shows separate sections for all steps but I don't know how much is @hug-dev attached to that 😉

Jakuje added 2 commits June 13, 2025 09:07
Fixes: parallaxsecond#282

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
@wiktor-k
Copy link
Collaborator Author

I've cherry-picked your commits from the other PR... let's see how many tests will be green now :)

@wiktor-k wiktor-k requested a review from hug-dev June 13, 2025 07:11
Copy link
Collaborator

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

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

Sounds like all of them were fixed :)

I like the idea of running on the whole matrix. It makes it easier to catch all possible oddness (but really the most common one is the ulong size which demonstrates on 32b arches). The linux-x86_64 is missing though.

On the other hand, I would probably be interested in running the test on 32b arch too (can be separate PR based on what I did in #283). We can probably do it easily only on i386 though. We might get the arm64 runner as mentioned in #285 and we might be able to run there the arm32 binaries, but I never played around this and I an skeptical it will show other errors than the i386 ones.


cargo build --target "$TARGET"

cargo test
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably change this to run only if the arch triplet matches the system we run on. Either simply by running this when TARGET is x86_64-unknown-linux-gnu . Or somehow dynamically if we will use different runners.

Otherwise we run the same tests 13 times in the same configuration here.

- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-freebsd
- riscv64gc-unknown-linux-gnu
Copy link
Collaborator

Choose a reason for hiding this comment

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

we are missing the "default" target here now. Something like x86_64-unknown-linux-gnu, which was probably excluded from the previous list as it was running when there was no --target provided (and which now builds when we call cargo test.

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