From 3ffe65d70683b0284d8360d15be65618915b62d4 Mon Sep 17 00:00:00 2001 From: Artem Savchenko Date: Sat, 21 Feb 2026 20:50:40 +0700 Subject: [PATCH 1/2] Update rust version and add CI verification Signed-off-by: Artem Savchenko --- .github/workflows/pr-checks.yml | 51 +++++++++++++++++++++++++++++++++ hulykvs_server/Dockerfile | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-checks.yml diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..1f13a6c --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,51 @@ +name: PR Checks + +on: + pull_request: + +jobs: + validate-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.88.0" + components: rustfmt, clippy + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Format check + run: cargo fmt --all --check + + - name: Lint + run: cargo clippy --workspace --all-targets + + - name: Tests + run: cargo test --workspace --all-targets --locked + + docker-build-verify: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Verify multi-arch Docker build + uses: docker/build-push-action@v6 + with: + context: . + file: hulykvs_server/Dockerfile + push: false + platforms: linux/amd64,linux/arm64 diff --git a/hulykvs_server/Dockerfile b/hulykvs_server/Dockerfile index a84cc3b..dbc8715 100644 --- a/hulykvs_server/Dockerfile +++ b/hulykvs_server/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM rust:1.86 AS builder +FROM --platform=$BUILDPLATFORM rust:1.88 AS builder ARG TARGETPLATFORM WORKDIR /tmp/build From 213f3534cb3a53432aeab3174dad2325e3e846c1 Mon Sep 17 00:00:00 2001 From: Artem Savchenko Date: Sat, 21 Feb 2026 20:52:52 +0700 Subject: [PATCH 2/2] Fix formatting Signed-off-by: Artem Savchenko --- hulykvs_server/src/main.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hulykvs_server/src/main.rs b/hulykvs_server/src/main.rs index fe5651c..51ccfc3 100644 --- a/hulykvs_server/src/main.rs +++ b/hulykvs_server/src/main.rs @@ -147,14 +147,18 @@ async fn main() -> anyhow::Result<()> { info!(?backend, "detected database backend"); let report = match backend { - DbBackend::Cockroach => migrations_crdb::migrations::runner() - .set_migration_table_name("migrations") - .run_async(&mut connection) - .await?, - DbBackend::Postgres => migrations_pg::migrations::runner() - .set_migration_table_name("migrations_pg") - .run_async(&mut connection) - .await?, + DbBackend::Cockroach => { + migrations_crdb::migrations::runner() + .set_migration_table_name("migrations") + .run_async(&mut connection) + .await? + } + DbBackend::Postgres => { + migrations_pg::migrations::runner() + .set_migration_table_name("migrations_pg") + .run_async(&mut connection) + .await? + } }; for m in report.applied_migrations().iter() {