diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab4e60b..b0b6542 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,31 +22,66 @@ env: CARGO_TERM_COLOR: always jobs: - rust: + metadata: runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 5 steps: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 - name: Verify lockfile run: cargo metadata --locked --format-version 1 >/dev/null + + format: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt - name: Format run: cargo fmt --all -- --check - - name: Check + + check: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v2 + - name: Workspace check run: cargo check --workspace --all-targets --locked + - name: Wasm check + run: cargo check -p fastmulp-wasm --target wasm32-unknown-unknown --locked + + clippy: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 - name: Clippy run: cargo clippy --workspace --all-targets --locked -- -D warnings - - name: Test + + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Workspace tests run: cargo test --workspace --lib --tests --examples --locked - - name: Doc test (core) - run: cargo test -p fastmulp-core --doc --locked - - name: Doc test (wasm) - run: cargo test -p fastmulp-wasm --doc --locked - - name: Wasm check - run: cargo check -p fastmulp-wasm --target wasm32-unknown-unknown --locked + - name: Doc tests + run: | + cargo test -p fastmulp-core --doc --locked + cargo test -p fastmulp-wasm --doc --locked bench: if: github.event_name == 'workflow_dispatch' diff --git a/package.json b/package.json index 2c20386..41bdc46 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "fmt:check": "cargo fmt --all -- --check", "lint": "cargo clippy --workspace --all-targets --locked -- -D warnings", "check": "cargo check --workspace --all-targets --locked", - "test": "cargo test --workspace --lib --tests --examples --locked && cargo test -p fastmulp-core --doc --locked && cargo test -p fastmulp-wasm --doc --locked", - "ci:local": "pnpm fmt:check && pnpm lint && pnpm test && cargo check -p fastmulp-wasm --target wasm32-unknown-unknown --locked", + "check:wasm": "cargo check -p fastmulp-wasm --target wasm32-unknown-unknown --locked", + "test": "cargo test --workspace --lib --tests --examples --locked", + "test:doc": "cargo test -p fastmulp-core --doc --locked && cargo test -p fastmulp-wasm --doc --locked", + "ci:local": "cargo metadata --locked --format-version 1 >/dev/null && pnpm fmt:check && pnpm check && pnpm check:wasm && pnpm lint && pnpm test && pnpm test:doc", "bench": "cargo bench -p fastmulp-core --bench parse --locked", "package:core": "cargo package -p fastmulp-core --locked --allow-dirty --list && cargo publish -p fastmulp-core --locked --allow-dirty --dry-run", "release:patch": "./scripts/release.sh patch",