From 3e2d18b0e8a7ede086b32475804dbd335a962fec Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 29 Sep 2026 10:46:48 -0300 Subject: [PATCH] ci: fmt, clippy and tests --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++ crates/fila-codec/src/lib.rs | 4 ++++ rust-toolchain.toml | 1 + 3 files changed, 46 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e0962e1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + fmt: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup show + - run: cargo fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup show + - uses: Swatinem/rust-cache@63fed3e2fecf6f7b51dc6f043341b79ef82a9ae7 # v2.9.2 + - name: fila-codec builds without an OS + run: cargo check -p fila-codec --target wasm32-unknown-unknown --locked + - run: cargo clippy --workspace --all-targets --locked -- -D warnings + + test: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup show + - uses: Swatinem/rust-cache@63fed3e2fecf6f7b51dc6f043341b79ef82a9ae7 # v2.9.2 + - run: cargo test --workspace --locked diff --git a/crates/fila-codec/src/lib.rs b/crates/fila-codec/src/lib.rs index e90b7f1a..aa065163 100644 --- a/crates/fila-codec/src/lib.rs +++ b/crates/fila-codec/src/lib.rs @@ -1,3 +1,7 @@ +#![no_std] + +extern crate alloc; + pub struct Bar; impl Bar { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e6300496..56e869fa 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,3 +2,4 @@ channel = "1.98.1" profile = "minimal" components = ["clippy", "rustfmt"] +targets = ["wasm32-unknown-unknown"]