Feature/twsapi client python port #115
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| check: | |
| name: fmt / clippy / test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Format | |
| run: cargo fmt --all --check | |
| - name: Install Protocol Buffers compiler | |
| run: sudo apt-get update && sudo apt-get install --yes protobuf-compiler | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| - name: Test | |
| run: cargo test --workspace | |
| deny: | |
| name: cargo-deny (licenses/advisories) | |
| runs-on: ubuntu-latest | |
| # cargo-deny-action runs its own bundled toolchain inside a container (musl-targeted); our | |
| # rust-toolchain.toml pins an exact channel for our own dev/CI builds, which the container | |
| # doesn't have installed for its (non-gnu) host target. A prior fix tried overriding this via | |
| # the RUSTUP_TOOLCHAIN env var set to "stable", but that only *points* rustup at an | |
| # already-installed toolchain of that exact name — the container's default is literally named | |
| # e.g. "1.85.0-x86_64-unknown-linux-musl", not "stable", so the override still failed to | |
| # resolve. The action's own `rust-version` input actually provisions the requested toolchain | |
| # (rather than assuming one already exists under that name), which is the documented mechanism | |
| # for this. | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| rust-version: stable | |
| sql: | |
| name: SQL backends (sqlite/postgres/mysql) | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| mysql: | |
| image: mysql:8 | |
| env: | |
| MYSQL_ROOT_PASSWORD: mysql | |
| MYSQL_DATABASE: truefix | |
| ports: ["3306:3306"] | |
| options: >- | |
| --health-cmd "mysqladmin ping -h localhost" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| # The SQL tests read these and skip a backend whose URL is absent; SQLite always runs. | |
| DATABASE_URL_PG: postgres://postgres:postgres@localhost:5432/postgres | |
| DATABASE_URL_MYSQL: mysql://root:mysql@localhost:3306/truefix | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test (sql feature, all backends) | |
| run: cargo test -p truefix-store -p truefix-log --features sql | |
| mssql: | |
| name: MSSQL backend (mssql feature) | |
| runs-on: ubuntu-latest | |
| services: | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2022-latest | |
| env: | |
| ACCEPT_EULA: Y | |
| MSSQL_SA_PASSWORD: TrueFix_Test1 | |
| ports: ["1433:1433"] | |
| options: >- | |
| --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $MSSQL_SA_PASSWORD -C -Q 'SELECT 1' || exit 1" | |
| --health-interval=10s --health-timeout=5s --health-retries=10 --health-start-period=10s | |
| env: | |
| # T073/T076 (US14, FR-020): the MSSQL tests read this and skip if absent, so dev boxes | |
| # without the service still pass; CI always sets it. | |
| DATABASE_URL_MSSQL: mssql://sa:TrueFix_Test1@localhost:1433/master | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test (mssql feature) | |
| run: cargo test -p truefix-store -p truefix-log --features mssql | |
| redb: | |
| name: Embedded transactional store (redb feature) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test (redb feature) | |
| # US5, feature 004: no external service needed (redb is embedded, like SQLite), | |
| # so this runs unconditionally, unlike the mssql/mongo jobs' service containers. | |
| run: cargo test -p truefix-store -p truefix-log --features redb | |
| mongo: | |
| name: MongoDB backend (mongodb feature) | |
| runs-on: ubuntu-latest | |
| env: | |
| # US6, feature 004: the MongoDB tests read this and skip if absent, so dev boxes without the | |
| # service still pass; CI always sets it. | |
| # T024/T025, feature 009 (NEW-08): directConnection=true bypasses replica-set topology | |
| # discovery (which would otherwise require the primary's advertised host to match | |
| # "localhost:27017"), since save_and_advance_sender's multi-document transaction needs a | |
| # replica-set/sharded deployment -- a standalone mongod (the previous setup here) rejects | |
| # transactions with IllegalOperation. | |
| DATABASE_URL_MONGO: mongodb://localhost:27017/?directConnection=true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Start MongoDB (single-node replica set, needed for transactions) | |
| run: | | |
| docker run -d --name mongo -p 27017:27017 mongo:7 --replSet rs0 | |
| for i in $(seq 1 30); do | |
| docker exec mongo mongosh --quiet --eval 'db.runCommand({ping:1})' && break | |
| sleep 1 | |
| done | |
| docker exec mongo mongosh --quiet --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "localhost:27017"}]})' | |
| for i in $(seq 1 30); do | |
| docker exec mongo mongosh --quiet --eval 'db.hello().isWritablePrimary' | grep -q true && break | |
| sleep 1 | |
| done | |
| - name: Test (mongodb feature) | |
| run: cargo test -p truefix-store -p truefix-log --features mongodb | |
| dict-tooling: | |
| name: Orchestra conversion tool + truefix-dict CLI (dict-tooling feature) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test (dict-tooling feature) | |
| run: cargo test -p truefix-dict --features dict-tooling | |
| bench: | |
| name: Benchmarks (informational, non-blocking) | |
| runs-on: ubuntu-latest | |
| # Observation/regression tooling (US11, FR-014): no numeric latency SLO is enforced, per | |
| # Clarifications, so this job must never block a merge — continue-on-error keeps its status | |
| # visible without gating. | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run benchmarks (codec throughput, session round-trip latency) | |
| run: | | |
| cargo bench -p truefix-core | |
| cargo bench -p truefix-session |