diff --git a/.github/workflows/_build-and-test-locally.yml b/.github/workflows/_build-and-test-locally.yml index f97402a90b92..8a7bd60fa7d7 100644 --- a/.github/workflows/_build-and-test-locally.yml +++ b/.github/workflows/_build-and-test-locally.yml @@ -204,6 +204,25 @@ jobs: done fi + - name: Check diesel schema + if: inputs.build-type == 'release' && inputs.arch == 'x64' + env: + DATABASE_URL: postgresql://localhost:1235/storage_controller + run: | + 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 + + cargo neon storage_controller stop + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/.github/workflows/_check-codestyle-rust.yml b/.github/workflows/_check-codestyle-rust.yml index f72ab7c9c653..f7518d650027 100644 --- a/.github/workflows/_check-codestyle-rust.yml +++ b/.github/workflows/_check-codestyle-rust.yml @@ -92,38 +92,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: Compile required thing - run: | - make postgres-v16 -j$(nproc) - make neon -j$(nproc) - - - 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