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 f3799e8df0..22cbdeda3a 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -45,7 +45,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 @@ -53,6 +53,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" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run cargo check run: cargo check --locked --workspace --all-targets @@ -621,11 +629,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 @@ -642,13 +697,7 @@ jobs: with: # Shares cross multiple jobs shared-key: "coverage-test" - cache-all-crates: "true" 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 ];