Skip to content

Commit

Permalink
build-and-test-locally: check diesel schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Jan 31, 2025
1 parent 361222e commit 916f64c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 35 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/_build-and-test-locally.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/_check-codestyle-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 916f64c

Please sign in to comment.