name: CI
on:
push:
branches: [main, dev, release/*, feature/*]
pull_request:
branches: [main, dev, release/*]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rust:
if: ${{ github.server_url == 'https://github.com' }}
name: Rust ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Build CLI
run: cargo build --locked
- name: Run CLI unit tests
run: cargo test --locked --bin solverforge
- name: Run scaffold contract tests
run: cargo test --locked --test scaffold_test -- --nocapture --test-threads=1
integration:
if: ${{ github.server_url == 'https://github.com' }}
name: Integration Tests
runs-on: ubuntu-latest
needs: [rust]
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pre-commit
shell: bash
run: python -m pip install --upgrade pip pre-commit
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: package-lock.json
- name: Install Node dependencies
run: npm ci
- name: Install Playwright Chromium
run: make install-e2e
- name: Run pre-commit
run: make pre-commit
- name: Run full integration validation
run: make test-full
- name: Upload integration artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-test-artifacts
path: target/test-artifacts
if-no-files-found: ignore