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 Rust CI #35

Merged
merged 33 commits into from
Jan 11, 2024
Merged

Add Rust CI #35

merged 33 commits into from
Jan 11, 2024

Conversation

sanders41
Copy link
Collaborator

No description provided.

@prrao87
Copy link
Member

prrao87 commented Jan 11, 2024

Haha seems like I forgot to run cargo fmt prior to my last commit 😂
Shows the importance of CI, I guess!

@sanders41
Copy link
Collaborator Author

The weird thing is when I run it locally it passes. Debugging github actions drives me crazy! You just have to push and see what happens.

@prrao87
Copy link
Member

prrao87 commented Jan 11, 2024

@sanders41 the test errors are more serious, but I don't see how we'd fix that because the sqlx query! macro requires that the database connection exists and is valid prior to compilation. But in CI, we don't have a database on the runner. Can we disable the checks just for that?

Compile-time SQL checks are the biggest benefit of sqlx over anything in Python, so I'd love to keep that and not switch to using the query or query_as methods.

@sanders41
Copy link
Collaborator Author

This step sets everything up and is working locally, I'm trying to figure out why CI isn't happy with it.

      - name: Prep data # This prevents sqlx errors if the database isn't running
        run: sh ./scripts/prep_tests.sh

@prrao87
Copy link
Member

prrao87 commented Jan 11, 2024

Yup, I also always hated debugging GitHub actions! It's among the worst developer experience one can see these days.

@sanders41
Copy link
Collaborator Author

For the format error it really was that the formatter needed running after I merged main. For Clippy and testing sqlx is definitely winning this battle so far 😄 . I've tried all kinds of things and so far nothing makes it happy.

I'm stubborn though, I'm not giving up yet!

@sanders41
Copy link
Collaborator Author

FINALLY I got it to work. The last piece keeping things from working was I needed to create the scripts/data directory before copying the file. This was causing the docker startup to fail, but it didn't show up in the GH actions log.

@sanders41 sanders41 merged commit 89b7803 into main Jan 11, 2024
3 checks passed
@prrao87
Copy link
Member

prrao87 commented Jan 11, 2024

Nice! Glad it worked out after all that effort!

Do you normally prune old branches in bulk or keep them for a few days? I just tend to keep things clean and have the fewest branches possible.

@sanders41 sanders41 deleted the rust-ci branch January 11, 2024 22:37
@sanders41
Copy link
Collaborator Author

Actually I usually turn on the setting that auto deletes the branches when they merge. I just forgot to delete this one.

@prrao87
Copy link
Member

prrao87 commented Jan 11, 2024

I wasn't aware there was such a setting 😂 And I was surprised someone so meticulous as you would keep unused branches lying around, I should have known there was a better way and just asked you! I'll activate that setting.

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