crosslink feature translation arc #79
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: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # =========================================== | |
| # Linting - runs on Ubuntu for speed | |
| # =========================================== | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| chainlink/target/ | |
| key: ${{ runner.os }}-cargo-lint-${{ hashFiles('chainlink/Cargo.lock') }} | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy (strict) | |
| run: cargo clippy -- -D warnings -W clippy::unwrap_used -W clippy::expect_used | |
| # =========================================== | |
| # Security Audit | |
| # =========================================== | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Run security audit | |
| run: cargo audit | |
| # =========================================== | |
| # Tests - Cross Platform | |
| # =========================================== | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| env: | |
| # Keep proptest cases low here — the dedicated Property Tests job runs 1000 | |
| PROPTEST_CASES: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| chainlink/target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('chainlink/Cargo.lock') }} | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run unit tests | |
| run: cargo test --bin chainlink --verbose | |
| - name: Run integration tests | |
| run: cargo test --test cli_integration --verbose | |
| # =========================================== | |
| # Property-Based Tests (extended) | |
| # =========================================== | |
| proptest: | |
| name: Property Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| chainlink/target/ | |
| key: ${{ runner.os }}-cargo-proptest-${{ hashFiles('chainlink/Cargo.lock') }} | |
| - name: Run property-based tests (extended) | |
| run: cargo test proptest --bin chainlink -- --test-threads=1 | |
| env: | |
| PROPTEST_CASES: 1000 | |
| # =========================================== | |
| # Fuzzing (Linux only, nightly) | |
| # =========================================== | |
| fuzz: | |
| name: Fuzz Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz --locked | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| chainlink/target/ | |
| chainlink/fuzz/target/ | |
| key: ${{ runner.os }}-cargo-fuzz-${{ hashFiles('chainlink/Cargo.lock') }} | |
| - name: Fuzz create_issue (30 seconds) | |
| run: cargo +nightly fuzz run fuzz_create_issue -- -max_total_time=30 | |
| continue-on-error: true | |
| - name: Fuzz search (30 seconds) | |
| run: cargo +nightly fuzz run fuzz_search -- -max_total_time=30 | |
| continue-on-error: true | |
| - name: Fuzz import (30 seconds) | |
| run: cargo +nightly fuzz run fuzz_import -- -max_total_time=30 | |
| continue-on-error: true | |
| # =========================================== | |
| # Build Release Binaries | |
| # =========================================== | |
| build-release: | |
| name: Build Release (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| working-directory: chainlink | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| artifact: chainlink-linux | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact: chainlink-macos | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact: chainlink-win.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install musl-tools (Linux only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build release | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: chainlink/target/${{ matrix.target }}/release/chainlink${{ matrix.os == 'windows-latest' && '.exe' || '' }} |