49 lines
1,013 B
Markdown
49 lines
1,013 B
Markdown
# docker-builder-rust
|
|
|
|
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@v2.3.0
|
|
with:
|
|
args: nightly cargo test
|
|
- uses: https://git.kemitix.net/kemitix/rust@v2.3.0
|
|
with:
|
|
args: v1.79.0 cargo build
|
|
```
|
|
|
|
The `args` is one of the following:
|
|
|
|
- <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.
|
|
|
|
|
|
## Contents
|
|
|
|
- nodejs
|
|
- rust
|
|
- git
|
|
- 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
|
|
[profile.dev]
|
|
debug = 0
|
|
strip = "debuginfo"
|
|
```
|