rust/README.md
Paul Campbell 41d2bb484e
All checks were successful
/ test (push) Successful in 5s
docs: update README to current syntax
2024-09-16 16:18:24 +01:00

51 lines
939 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@v1.80.0
with:
args: cargo test
- uses: https://git.kemitix.net/kemitix/rust@v1.80.0
with:
args: cargo build
```
## Contents
- nodejs
- clang-16
- mold
- rust
- git
- cargo
- cargo-binstall
## Linking
To take advantage of the clang and mold packages, add the following to the `.cargo/config.toml` file in your project.
```toml
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang-16"
rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]
```
## 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"
```