3 releases (breaking)
0.3.0 | Nov 17, 2022 |
---|---|
0.2.0 | Nov 12, 2022 |
0.1.0 | Nov 12, 2022 |
#512 in Testing
8KB
rustere
Rust Template repository
Description • Install • Usage • Use this template • Contribute
Description
rustere
stands for Rust template repository.
It's just a template repository for Rust, with the following features :
- :octocat: CI with Github actions :
- Code formatting
- Code checks
- Unit-tests
- 📝 Issues & PR templates
- 🤖 Stale bot & Dependabot
- 🚀 Releases automatically published to crates.io
Install
Install rustere
by running :
cargo install rustere
Usage
rustere
does not contain any useful code because it's a template repository.
But you can run the following command to check if the package was correctly installed :
rustere
Use this template
To use this template, click the button "Use this template" :
It will prompt you to create a new Github repository.
Then replace the content in your freshly created repository, with your own package name, own code, and update the links to point to your own repository.
Here is an exhaustive list of things to do :
- Add your content :
- Change
cargo.toml
: Replace the name of the package, the version, the author, the description, and the homepage. - Replace
README.md
: You can keep the same README outline, but you must update the core content to fit what you're building. Make sure to replace any occurence ofastariul
with your own username, and replace any occurence ofrustere
with the name of your package. - Add your code : Erase the content of
src/main.rs
andsrc/lib.rs
and put your own code. - Replace the tests : Replace the content of
tests/integration_tests.rs
with actual tests. - Update names and links in
.github/
folder :- In
.github/ISSUE_TEMPLATE/bug.yaml
, replacerustere
with the name of your package. - In
.github/ISSUE_TEMPLATE/config.yml
, replaceastariul/rustere
by your own<user>/<repo>
.
- In
- Optionally, if there are some features you don't want (like Github action that automatically release your code to
crates.io
), you can remove it !
- Change
- Enable Dependabot : From the Github website, on your repository page, you can enable Dependabot by going to the
Settings
tab of your repository, then in theSecurity & analysis
section you can enableDependabot alerts
andDependabot security updates
. - Add your
crates.io
API token : The Github action that automatically publish your package tocrates.io
requires your API token. You can store this API token in a Github secret.
To do this, go to theSettings
tab of your Github repository, then go to theSecrets
section, and click the buttonNew repository secret
.
Then set the name of the secret asCARGO_REGISTRY_TOKEN
, and paste your API token in the value field.
Contribute
To contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !
Code formatting
Ensure the code you added is properly formatted with :
cargo fmt
Tests
When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !
You can run the tests with :
cargo test
Documentation
The documentation should be kept up-to-date. You can visualize the documentation locally by running :
cargo doc --open