Skip to content

Bump the minor-updates group across 1 directory with 4 updates #1424

Bump the minor-updates group across 1 directory with 4 updates

Bump the minor-updates group across 1 directory with 4 updates #1424

Workflow file for this run

name: DB migrations
on:
push:
branches: ["master"]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
env:
DB_DATABASE: testdb2
DB_USER: root
DB_PASSWORD: ''
steps:
# PREPARATION
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install the project
run: uv sync --locked --no-dev
# SQLITE
- name: Load migrations on sqlite
env:
FLASK_APP: collectives:create_app
SQLALCHEMY_DATABASE_URI: sqlite+pysqlite:///app.version.db
run: |
uv run flask db upgrade
- name: Test if migrations are ok on sqlite
env:
FLASK_APP: collectives:create_app
SQLALCHEMY_DATABASE_URI: sqlite+pysqlite:///app.version.db
run: |
EXPECTED="$(uv run flask db heads)"
CURRENT="$(uv run flask db current)"
echo Expected : $EXPECTED
echo Current : $CURRENT
[[ "$EXPECTED" == "$CURRENT"* ]]
# MARIADB
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up MariaDB
uses: ankane/setup-mariadb@v1
with:
database: ${{ env.DB_DATABASE }}
mariadb-version: "10.11"
- name: Load migrations on MariaDB
env:
FLASK_APP: collectives:create_app
SQLALCHEMY_DATABASE_URI: mysql+pymysql://${{ env.DB_USER }}:${{ env.DB_PASSWORD }}@localhost:3306/${{ env.DB_DATABASE }}?charset=utf8mb4
run: |
uv run flask db upgrade
- name: Test if migrations are ok on MariaDB
env:
FLASK_APP: collectives:create_app
SQLALCHEMY_DATABASE_URI: mysql+pymysql://${{ env.DB_USER }}:${{ env.DB_PASSWORD }}@localhost:3306/${{ env.DB_DATABASE }}?charset=utf8mb4
run: |
EXPECTED="$(uv run flask db heads)"
CURRENT="$(uv run flask db current)"
echo Expected : $EXPECTED
echo Current : $CURRENT
[[ "$EXPECTED" == "$CURRENT"* ]]