polymarket-client-sdk 0.4.3

Polymarket CLOB (Central Limit Order Book) API client SDK
Documentation
name: CI

permissions:
  contents: read

on:
  push:
    branches: [main]
  pull_request:

jobs:
  build-test:
    runs-on: ${{ matrix.os }}-latest
    strategy:
      matrix:
        os: [ macos, windows ]

    steps:
      - uses: actions/checkout@v6
      - run: cargo build --all-targets --all-features
      - run: cargo test

  fmt-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Install stable Rust
        uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
        with:
          components: clippy
          toolchain: '1.88'

      - name: Install nightly Rust
        uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
        with:
          components: rustfmt
          toolchain: 'nightly-2025-11-24'

      - name: Rustfmt (nightly)
        # Run nightly formatting to allow group imports
        run: cargo +nightly-2025-11-24 fmt --all -- --check

      - name: Clippy (All features)
        run: cargo +1.88 clippy --all-targets --all-features -- -D warnings

      - name: Clippy
        run: cargo +1.88 clippy --all-targets -- -D warnings

  cargo-sort:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Install cargo-sort
        uses: baptiste0928/cargo-install@v3
        with:
          crate: 'cargo-sort'
          version: 'v2.0.2'

      - name: Check Cargo.toml sorting
        run: cargo sort --check

  test-coverage:
    name: build-test (ubuntu) with coverage
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install stable Rust
        uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
        with:
          toolchain: '1.88'
          components: llvm-tools-preview

      - name: Install cargo-llvm-cov
        uses: baptiste0928/cargo-install@v3
        with:
          crate: cargo-llvm-cov

      - name: Test with coverage
        run: |
          cargo llvm-cov clean --workspace
          cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        if: ${{ github.repository_owner == 'Polymarket' }}
        with:
          files: lcov.info
          flags: rust
          name: rust-llvm-cov
          token: ${{ secrets.CODECOV_TOKEN }}