Skip to content

Commit

Permalink
ci: Rename alembic-check-multiple-heads to check-alembic-migrations (#…
Browse files Browse the repository at this point in the history
…2484)

Backported-from: main (24.09)
Backported-to: 24.03
Backport-of: 2484
  • Loading branch information
achimnol committed Jul 17, 2024
1 parent 0fd11d1 commit 471616e
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,33 @@ jobs:
if: always() # We want the log even on failures.


check-alembic-migrations:
if: |
${{ contains(github.event.pull_request.labels.*.name, 'require:db-migration')
&& !contains(fromJSON('["flow:merge-queue", "flow:hotfix"]'), github.event.label.name)
&& github.event.pull_request.merged == false
&& needs.optimize-ci.outputs.skip == 'false'
}}
needs: [optimize-ci]
runs-on: ubuntu-latest
steps:
- name: Check out the revision
uses: actions/checkout@v4
with:
lfs: false
- name: Parse versions from config
run: |
PYTHON_VERSION=$(grep -m 1 -oP '(?<=CPython==)([^"]+)' pants.toml)
echo "PANTS_CONFIG_FILES=pants.ci.toml" >> $GITHUB_ENV
echo "PROJECT_PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
- name: Set up Python as Runtime
uses: actions/setup-python@v5
with:
python-version: ${{ env.PROJECT_PYTHON_VERSION }}
- name: Check for multiple heads
run: python scripts/check-multiple-alembic-heads.py


typecheck:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') && github.event.pull_request.merged == false }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -211,7 +238,7 @@ jobs:


build-scies:
needs: [lint, typecheck, test]
needs: [lint, typecheck, test, check-alembic-migrations]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
fail-fast: false
Expand Down Expand Up @@ -270,7 +297,7 @@ jobs:


build-wheels:
needs: [lint, typecheck, test]
needs: [lint, typecheck, test, check-alembic-migrations]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -336,7 +363,7 @@ jobs:
if: always() # We want the log even on failures.

build-sbom:
needs: [lint, typecheck, test]
needs: [lint, typecheck, test, check-alembic-migrations]
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
uses: ./.github/workflows/sbom.yml

Expand Down

0 comments on commit 471616e

Please sign in to comment.