diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 3fd7db2be6..4421264c39 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -1,9 +1,6 @@ name: Check Dependencies on: - push: - branches: - - main pull_request: branches: - main diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 7df24a8b64..76c5ca7a7f 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -43,7 +43,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-2022, ubuntu-20.04 ] + os: [ ubuntu-20.04 ] timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -51,12 +51,14 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # # Shares with `Clippy` job - # shared-key: "check-lint" + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + # Shares across multiple jobs + # Shares with `Clippy` job + shared-key: "check-lint" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run cargo check run: cargo check --locked --workspace --all-targets @@ -67,11 +69,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "check-toml" - name: Install taplo run: cargo +stable install taplo-cli --version ^0.9 --locked --force - name: Run taplo @@ -94,13 +91,15 @@ jobs: with: # Shares across multiple jobs shared-key: "build-binaries" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install cargo-gc-bin shell: bash run: cargo install cargo-gc-bin --force - name: Build greptime binaries shell: bash # `cargo gc` will invoke `cargo build` with specified args - run: cargo gc -- --bin greptime --bin sqlness-runner + run: cargo gc -- --bin greptime --bin sqlness-runner --features pg_kvbackend - name: Pack greptime binaries shell: bash run: | @@ -142,11 +141,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -200,11 +194,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -255,13 +244,15 @@ jobs: with: # Shares across multiple jobs shared-key: "build-greptime-ci" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install cargo-gc-bin shell: bash run: cargo install cargo-gc-bin --force - name: Build greptime bianry shell: bash # `cargo gc` will invoke `cargo build` with specified args - run: cargo gc --profile ci -- --bin greptime + run: cargo gc --profile ci -- --bin greptime --features pg_kvbackend - name: Pack greptime binary shell: bash run: | @@ -317,11 +308,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -466,11 +452,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -573,6 +554,9 @@ jobs: - name: "Remote WAL" opts: "-w kafka -k 127.0.0.1:9092" kafka: true + - name: "Pg Kvbackend" + opts: "--setup-pg" + kafka: false timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -609,11 +593,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: rustfmt - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "check-rust-fmt" - name: Check format run: make fmt-check @@ -635,6 +614,8 @@ jobs: # Shares across multiple jobs # Shares with `Check` job shared-key: "check-lint" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run cargo clippy run: make clippy @@ -646,11 +627,58 @@ jobs: - name: Merge Conflict Finder uses: olivernybroe/action-conflict-finder@v4.0 - coverage: - if: github.event.pull_request.draft == false + test: + if: github.event_name != 'merge_group' runs-on: ubuntu-20.04-8-cores timeout-minutes: 60 needs: [conflict-check, clippy, fmt] + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: rui314/setup-mold@v1 + - name: Install toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache: false + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + # Shares cross multiple jobs + shared-key: "coverage-test" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Install latest nextest release + uses: taiki-e/install-action@nextest + - name: Setup external services + working-directory: tests-integration/fixtures + run: docker compose up -d --wait + - name: Run nextest cases + run: cargo nextest run --workspace -F dashboard -F pg_kvbackend + env: + CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=mold" + RUST_BACKTRACE: 1 + CARGO_INCREMENTAL: 0 + GT_S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }} + GT_S3_ACCESS_KEY_ID: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} + GT_S3_ACCESS_KEY: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} + GT_S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} + GT_MINIO_BUCKET: greptime + GT_MINIO_ACCESS_KEY_ID: superpower_ci_user + GT_MINIO_ACCESS_KEY: superpower_password + GT_MINIO_REGION: us-west-2 + GT_MINIO_ENDPOINT_URL: http://127.0.0.1:9000 + GT_ETCD_ENDPOINTS: http://127.0.0.1:2379 + GT_POSTGRES_ENDPOINTS: postgres://greptimedb:admin@127.0.0.1:5432/postgres + GT_KAFKA_ENDPOINTS: 127.0.0.1:9092 + GT_KAFKA_SASL_ENDPOINTS: 127.0.0.1:9093 + UNITTEST_LOG_DIR: "__unittest_logs" + + coverage: + if: github.event_name == 'merge_group' + runs-on: ubuntu-20.04-8-cores + timeout-minutes: 60 steps: - uses: actions/checkout@v4 - uses: arduino/setup-protoc@v3 @@ -668,11 +696,6 @@ jobs: # Shares cross multiple jobs shared-key: "coverage-test" save-if: ${{ github.ref == 'refs/heads/main' }} - # Disabled temporarily to see performance - # - name: Docker Cache - # uses: ScribeMD/docker-cache@0.5.0 - # with: - # key: docker-${{ runner.os }}-coverage - name: Install latest nextest release uses: taiki-e/install-action@nextest - name: Install cargo-llvm-cov diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d12222a5d3..674d7d4694 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] channel = "nightly-2024-10-19" -components = ["rust-analyzer"] +components = ["rust-analyzer", "llvm-tools"] diff --git a/shell.nix b/shell.nix index e052ed6bea..d41b2527bb 100644 --- a/shell.nix +++ b/shell.nix @@ -11,11 +11,13 @@ pkgs.mkShell rec { clang gcc protobuf + gnumake mold (fenix.fromToolchainFile { dir = ./.; }) cargo-nextest + cargo-llvm-cov taplo curl ];