Skip to content

Commit

Permalink
check-codestyle-rust: check diesel schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Jan 27, 2025
1 parent 898470e commit a93db59
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/_check-codestyle-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
options: --init

permissions:
id-token: write # .github/actions/download

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -89,3 +92,33 @@ 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

0 comments on commit a93db59

Please sign in to comment.