From 63d46562c7a9786fea97d4c9b28f4041745e7ae0 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Fri, 17 Jul 2026 21:21:57 +0200 Subject: [PATCH] [chore](trx-rs): add Gitea Actions CI pipeline Introduce CI running on push to main and pull requests. Three jobs: lint (rustfmt check + clippy with -D warnings), test (build and test the workspace with --locked), and REUSE compliance. Installs the required system libraries (opus, alsa, soapysdr) and caches the cargo registry and target directory. Assisted-By: Claude Code (claude-opus-4) Claude-Session: https://claude.ai/code/session_01NFpGtGTWUEYXLwZeZs2RAV Signed-off-by: Stan Grams --- .gitea/workflows/ci.yml | 98 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 00000000..93bbd015 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2026 Stan Grams +# +# SPDX-License-Identifier: GPL-2.0-or-later + +name: CI + +on: + push: + branches: [main] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential pkg-config cmake \ + libopus-dev libasound2-dev libsoapysdr-dev + + - name: Set up Rust + run: | + if ! command -v rustup >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + fi + rustup toolchain install stable --profile minimal \ + --component rustfmt --component clippy + rustup default stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: cargo-${{ runner.os }}- + + - name: rustfmt + run: cargo fmt --all -- --check + + - name: clippy + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential pkg-config cmake \ + libopus-dev libasound2-dev libsoapysdr-dev + + - name: Set up Rust + run: | + if ! command -v rustup >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + fi + rustup toolchain install stable --profile minimal + rustup default stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: cargo-${{ runner.os }}- + + - name: Build + run: cargo build --workspace --all-targets --locked + + - name: Test + run: cargo test --workspace --locked + + reuse: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: REUSE compliance + uses: fsfe/reuse-action@v5