ci: add Android and Rust CI workflows #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust Continuous Integration | |
| on: | |
| push: | |
| paths: | |
| - "floresta-ffi/**" | |
| pull_request: | |
| paths: | |
| - "floresta-ffi/**" | |
| permissions: {} | |
| jobs: | |
| test: | |
| name: "Run tests" | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: floresta-ffi | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: "Set up Rust" | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache: false | |
| - name: "Check Cargo.lock" | |
| run: | | |
| if ! cargo check --locked; then | |
| echo "::error::Cargo.lock is stale. Run 'cargo generate-lockfile'." | |
| exit 1 | |
| fi | |
| - name: "Build" | |
| run: cargo build | |
| - name: "Test" | |
| run: cargo test | |
| check: | |
| name: "Run clippy and fmt" | |
| needs: test | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: floresta-ffi | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache: false | |
| components: clippy, rustfmt | |
| - name: "Check fmt" | |
| run: cargo fmt --all -- --check | |
| - name: "Check clippy" | |
| run: cargo clippy --all-targets |