Skip to content

chore: introduce cargo-deny and justfile improvements #794

chore: introduce cargo-deny and justfile improvements

chore: introduce cargo-deny and justfile improvements #794

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all --check
lockfile:
name: Lockfile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Verify Cargo.lock is up-to-date
run: cargo metadata --locked --format-version 1 >/dev/null
sort:
name: Cargo Sort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-sort
- run: cargo sort --workspace --check
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-deny
- run: cargo deny check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace --all-features -E 'not (package(s2-cli) & binary(integration))'
build-server:
name: Build s2-lite
uses: ./.github/workflows/build-s2-lite.yml
with:
ref: ${{ github.sha }}
sdk-integration-tests:
name: SDK Integration Tests
needs: [build-server, test, clippy]
uses: ./.github/workflows/sdk-tests.yml
with:
mode: local
server-binary: server
server-args: "--port 8080"
server-port: 8080
sdks: |
[
{
"name": "go",
"repo": "s2-streamstore/s2-sdk-go",
"ref": "main",
"lang": "go",
"go-version": "1.24",
"test_cmd": "go test -v -count=1 -skip 'WithScope|AccessToken|Metrics|Client_InvalidToken' ./s2/..."
},
{
"name": "typescript",
"repo": "s2-streamstore/s2-sdk-typescript",
"ref": "main",
"lang": "bun",
"bun-version": "latest",
"test_cmd": "S2_LITE=1 bun run vitest --run --exclude '**/account-basin*' --exclude '**/accessTokens*' --exclude '**/metrics*'"
},
{
"name": "rust",
"repo": "s2-streamstore/s2-sdk-rust",
"ref": "main",
"lang": "rust",
"test_cmd": "cargo test --all-features -- --skip access_token"
}
]
cli-integration-tests:
name: CLI Integration Tests
needs: [build-server, test, clippy]
uses: ./.github/workflows/sdk-tests.yml
with:
mode: local
server-binary: server
server-args: "--port 8080"
server-port: 8080
sdks: |
[
{
"name": "cli",
"repo": "${{ github.repository }}",
"ref": "${{ github.sha }}",
"lang": "rust",
"test_cmd": "cargo test -p s2-cli --test integration -j 1"
}
]