From fb5eff6c0c4614da8ac4610041c6354d568df235 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Mon, 27 Jan 2025 23:11:57 +0000 Subject: [PATCH] debug --- .github/workflows/_check-codestyle-rust.yml | 69 ++++++++++++--------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/.github/workflows/_check-codestyle-rust.yml b/.github/workflows/_check-codestyle-rust.yml index df177d32d5f0..7c334151a37b 100644 --- a/.github/workflows/_check-codestyle-rust.yml +++ b/.github/workflows/_check-codestyle-rust.yml @@ -53,6 +53,45 @@ jobs: - name: Get postgres headers run: make postgres-headers -j$(nproc) + # To check diesel schema, we need any version of Postgres, so get it from build artifacts + - name: Download Latest Neon artifact + if: ${{ !cancelled() }} + uses: ./.github/actions/download + with: + name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact + path: /tmp/neon/ + prefix: latest + aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} + + - name: Check diesel schema + if: ${{ !cancelled() }} + env: + POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install + DATABASE_URL: postgresql://localhost:1235/storage_controller + run: | + export LD_LIBRARY_PATH=${POSTGRES_DISTRIB_DIR}/v16/lib + + cargo neon init + cargo neon storage_controller start + + diesel print-schema > storage_controller/src/schema.rs + + if [ -n "$(git diff storage_controller/src/schema.rs)" ]; then + echo >&2 "Uncommitted changes in diesel schema" + + git diff . + exit 1 + fi + + - name: DEBUG + if: always() + run: | + for f in find . -name "*.log"; do + echo "=== $f ===" + cat $f + done + + # cargo hack runs the given cargo subcommand (clippy in this case) for all feature combinations. # This will catch compiler & clippy warnings in all feature combinations. # TODO: use cargo hack for build and test as well, but, that's quite expensive. @@ -92,33 +131,3 @@ jobs: - name: Check rust licenses/bans/advisories/sources if: ${{ !cancelled() }} run: cargo deny check --hide-inclusion-graph - - # To check diesel schema, we need any version of Postgres, so get it from build artifacts - - name: Download Latest Neon artifact - if: ${{ !cancelled() }} - uses: ./.github/actions/download - with: - name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact - path: /tmp/neon/ - prefix: latest - aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} - - - name: Check diesel schema - if: ${{ !cancelled() }} - env: - POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install - DATABASE_URL: postgresql://localhost:1235/storage_controller - run: | - export LD_LIBRARY_PATH=${POSTGRES_DISTRIB_DIR}/v16/lib - - cargo neon init - cargo neon storage_controller start - - diesel print-schema > storage_controller/src/schema.rs - - if [ -n "$(git diff storage_controller/src/schema.rs)" ]; then - echo >&2 "Uncommitted changes in diesel schema" - - git diff . - exit 1 - fi