A template for cargo generate that aims to be a starting point suitable for the vast majority of rust projects that will be hosted on GitHub.
See the project website.
Template for a generic rust project hosted on GitHub
Home Page: https://rust-github.github.io/
License: MIT License
A template for cargo generate that aims to be a starting point suitable for the vast majority of rust projects that will be hosted on GitHub.
See the project website.
cargo generate --git https://github.com/rust-github/template.git
Project Name : app
Creating project called app
...
Error: Error replacing placeholders C:\Users\fdemi\AppData\Local\Temp\.tmpyuAG9z\.github\workflows\build.yml
Caused by:
liquid: Unknown variable
with:
requested variable=env
Have tried this within -
a git bash embedded in VScode with everything up to date.
a power shell with Windows Development environment established
an elevated Powershell
Nothing worked
Frank
caching would speed up CI execution
I noticed that https://github.com/cargo-generate/cargo-generate uses https://github.com/Swatinem/rust-cache
I saw that the setup is pretty simple. This is definitely a solution we have to consider.
I am also open to alternatives if you know better ones.
In #43 I removed the current code coverage approach because it wasn't working anymore.
What's the best way to do code coverage in rust today?
Possibilities:
When you run cargo generate
the user says if the crate is a binary or a library.
If it is a library, then crate a lib.rs
file instead of a main.rs
file.
Furthermore, the publish job from the cd doesn't have to be generated (You need to generate the cargo publish step only).
I noticed that babel asks in the issue template if you would like to work on the fix.
I think that this might be very nice because it's a question that I always ask after an issue has been reported, so maybe it would be useful for others, too.
With respect to the babel solution, I don't like the fact that the checkbox is interpreted as a task by github, so maybe I would just add the question to be answered in plain text (maybe with a [y/n]
) after the question
$ cargo generate --bin --name example rust-github/template
Favorite `rust-github/template` not found in config, using it as a git repository: https://github.com/rust-github/template.git
Destination: /home/vscode/example ...
project-name: example ...
Generating template ...
GitHub username (or organization): CodeMan99
Project description: Example
Moving generated files into: `/home/vscode/example`...
Initializing a fresh Git repository
Done! New project created /home/vscode/example
The https://github.com/rust-github/template/blob/main/template/.github/workflows/cd.yml file appears as-is without any interpolation of values.
HEAD
This repository is 1af92ab.
cargo-generate --version
I install version 0.18.5
via cargo install --locked cargo-generate
.
https://github.com/babel/babel/issues/new/choose (bug report and feature request) are really cool!
If you use the input box, you don't have to deal with markdown comments.
Can we bring the input boxes in our https://github.com/rust-github/template/tree/main/.github/ISSUE_TEMPLATE ?
Run coverallsapp/github-action@master
with:
github-token: ***
path-to-lcov: ./lcov.info
coveralls-endpoint: https://coveralls.io
env:
CACHE_ON_FAILURE: false
CARGO_INCREMENTAL: 0
Using lcov file: ./lcov.info
Error: "[2](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:2)022-08-02T09:11:[3](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:3)3.[7](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:7)7[8](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:8)Z" 'error from lcovParse: ' 'Failed to parse string'
Error: "2022-08-02T0[9](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:10):11:33.779Z" 'input: ' ''
Error: "2022-08-02T09:[11](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:12):33.779Z" 'error from convertLcovToCoveralls'
Error: Failed to parse string
example-synchronizer periodically pulls this repo and pushes changes to the example if there are any.
This is not ideal, in fact a better solution will be to just push changes when there is one.
cargo generate recently introduced the possibility to have templates as a subdirectory of the repository.
In this way we can have the CI of example synchronizer in the top directory of this repo and we can move the whole template in a subdirectory (called template
for example).
Also add a minimal readme that points to https://rust-github.github.io/
If you get permissions issues in the CI while trying to push to rust-gh-example, I might need to add the secret token in this repo. Let's see.
Add in cargo-generate.toml the regex
field in order to check if the username inserted by the user is a valid github username/organization.
Documentation here.
They are unmaintained.
I have done some progress in #45
but they are still present.
Hi,
Is it normal that I am getting src/main.rs
even with cargo generate --lib rust-github/template
?
It is annoying to manually merge dependabot PRs.
We could use https://mergify.com/ to auto-approve and auto-merge dependabot PRs.
It is free for open source projects.
Cargo.toml description
field is mandatory in order to publish the crate on crates.io.
We should ask it as input to the user when he generates this template.
Please, add a default value also here
Right now the example has to be updated manually.
Do you know a way to update it automatically?
We can't add special github actions here or in the example repo, because otherwise they will conflict with the template.
Maybe there could be another repo that periodically checks for updates on this repo and pushes changes automatically to the example repo?
Add to cd a job to automatically publish to the snap store.
A question like "If this is a binary, would you like to create a snap?" should be asked when running cargo generate
.
Hi, @MarcoIeni
What is the syntax for this?
Any documentation for it?
Thanks a lot.
Environment variable CARGO_REGISTRY_TOKEN
is suggested for CI. Check if you can use it instead of CARGO_API_KEY
.
docs here
You can probably remove this line after:
template/template/.github/workflows/cd.yml
Line 121 in 44d7942
Also update the website docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.