From 59b5954ee8ab6fd8bd918f24a23a143892b57ab8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 17 Jul 2025 10:45:22 +0200 Subject: [PATCH] Fix SQL CI task --- .github/workflows/commit-sqlx-changes.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/commit-sqlx-changes.yml b/.github/workflows/commit-sqlx-changes.yml index 98509556e..16ee0aa69 100644 --- a/.github/workflows/commit-sqlx-changes.yml +++ b/.github/workflows/commit-sqlx-changes.yml @@ -21,7 +21,7 @@ permissions: contents: write jobs: - update-labels: + commit-sqlx-changes: if: ${{ github.event.pull_request.merged }} runs-on: ubuntu-latest steps: @@ -35,13 +35,7 @@ jobs: with: prefix-key: ${{ env.RUST_CACHE_KEY }} - - name: install SQLX CLI - run: cargo install sqlx-cli --no-default-features --features postgres - - - name: run database migrations - run: cargo sqlx migrate run --database-url $DOCSRS_DATABASE_URL - - - name: Commit sqlx changes on master branch if any + - name: Launch postgres run: | cp .env.sample .env mkdir -p ${DOCSRS_PREFIX}/public-html @@ -51,6 +45,11 @@ jobs: # Make sure the database is actually working psql "${DOCSRS_DATABASE_URL}" + - name: install SQLX CLI + run: cargo install sqlx-cli --no-default-features --features postgres + + - name: Commit sqlx changes on master branch if any + run: | just sqlx-prepare # If there are differences in the SQLX files, then we push them on the master branch if git status --porcelain .sqlx ; then