CI #60
Workflow file for this run
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] | |
| paths: | |
| - 'crates/**' | |
| - 'scripts/**' | |
| - 'tests/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/**' | |
| - 'rust-toolchain.toml' | |
| - 'Dockerfile' | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| lint: | |
| if: "!startsWith(github.event.head_commit.message, 'release:')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy --workspace --all-targets -- -D warnings | |
| test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo test --workspace | |
| - run: cargo build --release | |
| installed-smoke: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install release binaries into an isolated root | |
| run: | | |
| install_root="$RUNNER_TEMP/contextdb-installed" | |
| cargo install --locked --path crates/contextdb-cli --root "$install_root" | |
| cargo install --locked --path crates/contextdb-server --root "$install_root" \ | |
| --features production-smoke-driver --bins | |
| - name: Run installed release durability smoke | |
| run: | | |
| install_root="$RUNNER_TEMP/contextdb-installed" | |
| CONTEXTDB_CLI="$install_root/bin/contextdb" \ | |
| CONTEXTDB_SMOKE_DRIVER="$install_root/bin/contextdb-smoke-driver" \ | |
| CONTEXTDB_SERVER="$install_root/bin/contextdb-server" \ | |
| scripts/installed-release-durable-sync-smoke.sh | |
| cross-compile: | |
| needs: lint | |
| strategy: | |
| matrix: | |
| include: | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
| - run: cargo build --release --target ${{ matrix.target }} -p contextdb-cli -p contextdb-server |