name: CI on: push: branches: [main] pull_request: branches: [main] jobs: check: name: Vérification & lint runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Cache Cargo uses: actions/cache@v3 with: path: | ~/.cargo/registry ~/.cargo/git target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo- - name: Installation Rust stable uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Vérification compilation (cargo check) run: cargo check --workspace - name: Lint (cargo clippy) run: cargo clippy --workspace -- -D warnings - name: Format (cargo fmt) run: cargo fmt --all -- --check test: name: Tests runs-on: ubuntu-latest needs: check steps: - uses: actions/checkout@v4 - uses: actions/cache@v3 with: path: | ~/.cargo/registry ~/.cargo/git target/ key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable - name: Tests (cargo test) run: cargo test --workspace env: DATABASE_URL: sqlite://:memory: