rust/README.md

50 lines
1,015 B
Markdown
Raw Normal View History

2024-05-16 18:52:20 +01:00
# docker-builder-rust
2024-05-16 17:59:27 +01:00
2024-05-16 18:52:20 +01:00
Docker image for building Rust projects with Cargo.
## Usage
In a Forgejo action file, e.g. `.forgejo/workflows/test.yml`:
```yml
on: [push]
jobs:
test:
runs-on: docker
steps:
- uses: https://git.kemitix.net/kemitix/rust@v1.80.0
2024-05-16 18:52:20 +01:00
with:
args: nightly cargo test
- uses: https://git.kemitix.net/kemitix/rust@v1.80.0
2024-05-16 18:52:20 +01:00
with:
args: v1.79.0 cargo build
2024-05-16 18:52:20 +01:00
```
The `args` is one of the following:
2024-09-17 09:51:09 +01:00
- <COMMAND>
- [ nightly | stable | v1.xx.x ] <COMMAND>
`COMMAND` is the command you want to run. The optional prefix is the Rust toolchain, or version. Allowed values are `nightly`, `stable` or a Rust version.
Where the optional prefix is not given, the `stable` toolchain will be used.
2024-05-16 18:52:20 +01:00
## Contents
- nodejs
- rust
- git
2024-05-16 18:52:20 +01:00
- cargo
- cargo-binstall
## Binary size
To reduce the size of the debug binary, add the following to the `.cargo/config.toml` file in you project.
```toml
2024-05-17 06:56:50 +01:00
[profile.dev]
debug = 0
2024-05-16 18:52:20 +01:00
strip = "debuginfo"
```