Use mouse click to add a new time slot #440
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Alembic consistency check | |
on: | |
pull_request: | |
branches: [master] | |
jobs: | |
check-alembic: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Get list of created migrations | |
id: get-changed-files | |
uses: umani/changed-files@v4.2.0 | |
with: | |
repo-token: ${{ github.token }} | |
result-encoding: json | |
pattern: '^newdle/migrations/versions/.+\.py$' | |
- name: Check if any migrations changed | |
id: migrations-changed | |
run: | | |
echo changed=${{ steps.get-changed-files.outputs.files_created != '[]' || steps.get-changed-files.outputs.files_updated != '[]' || steps.get-changed-files.outputs.files_deleted != '[]' }} >> $GITHUB_OUTPUT | |
- name: Setup venv and config file | |
if: steps.migrations-changed.outputs.changed == 'true' | |
run: | | |
make config | |
PYTHON=python3.12 make env | |
pip install -q -e '.[dev]' | |
- name: Activate virtualenv for later steps | |
if: steps.migrations-changed.outputs.changed == 'true' | |
run: | | |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV | |
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH | |
- name: Check history consistency | |
if: steps.migrations-changed.outputs.changed == 'true' | |
run: python ./ci/check_history_consistency.py | |
- name: Store PR data | |
run: | | |
mkdir /tmp/migration-sql-data | |
echo ${{ github.event.number }} > /tmp/migration-sql-data/pull-request-id | |
- name: Print changed migrations | |
if: steps.migrations-changed.outputs.changed == 'true' | |
run: | | |
first_migration=$(echo '${{ steps.get-changed-files.outputs.files_created }}' | jq -r '.[0] // empty') | |
latest_migration=$(echo '${{ steps.get-changed-files.outputs.files_created }}' | jq -r '.[-1] // empty') | |
./ci/print_revision_sql.sh $first_migration $latest_migration > /tmp/migration-sql-data/upgrade.sql | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: migration-sql-data | |
path: /tmp/migration-sql-data | |
retention-days: 1 |