Forgejo action for building rust projects.
Paul Campbell
b961de0eec
All checks were successful
/ test (push) Successful in 38s
4.234 curl : Depends: libcurl4 (= 7.88.1-10+deb12u5) but 7.88.1-10+deb12u6 is to be installed4.236 libssl-dev : Depends: libssl3 (= 3.0.11-1~deb12u2) but 3.0.13-1~deb12u1 is to be installed4.236 nodejs : Depends: libnode108 (= 18.19.0+dfsg-6~deb12u1) but 18.19.0+dfsg-6~deb12u2 is to be installed |
||
---|---|---|
.forgejo/workflows | ||
src | ||
.gitignore | ||
Cargo.toml | ||
Dockerfile | ||
entrypoint.sh | ||
LICENSE | ||
README.md | ||
renovate.json |
docker-builder-rust
Docker image for building Rust projects with Cargo.
Usage
In a Forgejo action file, e.g. .forgejo/workflows/test.yml
:
on: [push]
jobs:
test:
runs-on: docker
steps:
- uses: https://git.kemitix.net/kemitix/rust@v1.80.0
with:
args: test
- uses: https://git.kemitix.net/kemitix/rust@v1.80.0
with:
args: 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.
[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.
[profile.dev]
debug = 0
strip = "debuginfo"