Skip to content

Add CI workflow to check Rust code#28

Open
taeh98 wants to merge 1 commit intomrjackwills:mainfrom
taeh98:main
Open

Add CI workflow to check Rust code#28
taeh98 wants to merge 1 commit intomrjackwills:mainfrom
taeh98:main

Conversation

@taeh98
Copy link
Copy Markdown

@taeh98 taeh98 commented Jul 28, 2023

Made a CI workflow file to find errors in Rust code and check its syntax and formatting. Should help keep it standardised and eliminate human error.

@mrjackwills
Copy link
Copy Markdown
Owner

mrjackwills commented Jul 28, 2023

Very cool thanks, I've not really used any CI on GitHub before, I use a basic workflow for release but that's about it.

At the moment, for adsbdb, and most of my other repos, I'm using a slightly delicate bash script, create_release.sh, which versions the release, runs cargo fmt, checks for typos with typos, formats the changelog correctly, runs the tests, and builds for all required platforms. Obviously this is all done locally, and will only push to main (with a semver tag) once it all succeeds.

The only issue I can see with this is that in order to run the tests, it requires a fully seeded database, and I am unaware of how we could do that via CI on GitHub - although as I say I have never really used a CI on GitHub before, so maybe there is an easy solution.

@taeh98
Copy link
Copy Markdown
Author

taeh98 commented Jul 28, 2023

At the moment, for adsbdb, and most of my other repos, I'm using a slightly delicate bash script, create_release.sh, which versions the release, runs cargo fmt, checks for typos with typos, formats the changelog correctly, runs the tests, and builds for all required platforms. Obviously this is all done locally, and will only push to main (with a semver tag) once it all succeeds.

I've added typos to the workflow and commitlint. It keeps commits in keeping with Conventional Commits, which is widely viewed as best practice, and enables automatic generation of a changelog and version/tag with something like semantic-release or release-please.

@taeh98
Copy link
Copy Markdown
Author

taeh98 commented Jul 28, 2023

The only issue I can see with this is that in order to run the tests, it requires a fully seeded database, and I am unaware of how we could do that via CI on GitHub - although as I say I have never really used a CI on GitHub before, so maybe there is an easy solution.

I've not had to run tests with a database in GH actions before, but something like this might help: https://atlasgo.io/guides/testing/github-actions

@mrjackwills
Copy link
Copy Markdown
Owner

Thanks, I'll have a read, and play around in a cloned private repo

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