servicepoint-binding-c/.github/workflows/rust.yml
Vinzenz Schroeter 826280b0df
Some checks failed
Rust / build (pull_request) Failing after 4m47s
ci needs unstable rust for size-optimized
2025-05-03 19:46:11 +02:00

58 lines
2 KiB
YAML

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update repos
run: sudo apt-get update -qq
- name: Install rust toolchain
run: sudo apt-get install -qy cargo rust-clippy
- name: install lzma
run: sudo apt-get install -qy liblzma-dev
- name: install gcc
run: sudo apt-get install -qy gcc make
- name: Run Clippy
run: cargo clippy
- name: generate bindings
run: ./generate-binding.sh
- name: check that generated files did not change
run: output=$(git status --porcelain) && [ -z "$output" ]
- name: build
run: cargo build
- name: build example -- glibc release
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=release
- name: build example -- glibc debug
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=debug
- name: build example -- musl release
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=release MUSL=1
- name: build example -- musl debug
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=debug MUSL=1
- name: install unstable rust
run: sudo apt install rustup && rustup toolchain install aarch64-unknown-linux-gnu && rustup toolchain install aarch64-unknown-linux-musl
- name: build example -- glibc size-optimized
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=size-optimized CARGO="rustup run nightly cargo"
- name: build example -- musl size-optimized
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=size-optimized MUSL=1 LTO=1 CARGO="rustup run nightly cargo"