name: CI
on:
push:
branches:
- main
pull_request:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout tideorm-cli
uses: actions/checkout@v6
with:
path: tideorm-cli
- name: Checkout tideorm
uses: actions/checkout@v6
with:
repository: mohamadzoh/tideorm
ref: master
path: tideorm
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: tideorm-cli
- name: Point the tideorm dependency at the sibling checkout
working-directory: tideorm-cli
run: |
sed -i -E 's|^tideorm = \{.*\}$|tideorm = { path = "../tideorm", default-features = false, features = ["postgres", "mysql", "sqlite", "runtime-tokio"] }|' Cargo.toml
grep -q 'path = "../tideorm"' Cargo.toml
- name: Run clippy
working-directory: tideorm-cli
run: cargo clippy --all-targets -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- name: Checkout tideorm-cli
uses: actions/checkout@v6
with:
path: tideorm-cli
- name: Checkout tideorm
uses: actions/checkout@v6
with:
repository: mohamadzoh/tideorm
ref: master
path: tideorm
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: tideorm-cli
- name: Point the tideorm dependency at the sibling checkout
working-directory: tideorm-cli
run: |
sed -i -E 's|^tideorm = \{.*\}$|tideorm = { path = "../tideorm", default-features = false, features = ["postgres", "mysql", "sqlite", "runtime-tokio"] }|' Cargo.toml
grep -q 'path = "../tideorm"' Cargo.toml
- name: Warm the cargo registry cache
working-directory: tideorm-cli
run: cargo fetch
- name: Run tests
working-directory: tideorm-cli
run: cargo test