on: push: branches: [master] pull_request: paths: - "src/**" - "build.rs" - "Cargo.toml" - "Cargo.lock" - ".forgejo/workflows/rust.yml" name: rust jobs: fmt: runs-on: docker container: ubuntu:latest name: format steps: - name: Init run: | apt-get -qq update apt-get -qqy install curl nodejs build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | RUSTUP_COMPONENTS=rustfmt,cargo sh -s -- -y -q --profile default export PATH=~/.cargo/bin:$PATH - uses: actions/checkout@v6 - name: Run rustfmt run: | . ~/.cargo/env cargo fmt --check test: runs-on: docker container: ubuntu:latest name: test steps: - name: Init run: | apt-get -qq update apt-get -qqy install curl nodejs build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | RUSTUP_COMPONENTS=rustc,cargo,clippy sh -s -- -y -q --profile default - uses: actions/checkout@v6 - name: Run tests run: | . ~/.cargo/env cargo test cargo clippy --tests -- -Dwarnings