Skip to content

ci: fix workflows #2958

ci: fix workflows

ci: fix workflows #2958

Workflow file for this run

name: Migration tests
on:
pull_request:
types: [opened, synchronize, reopened]
branches-ignore: ['l10n_main*']
release:
types: [created]
workflow_run:
workflows: ['Compress images']
types: [completed]
concurrency:
group: Migration tests ${{ github.ref }}
cancel-in-progress: true
jobs:
#####################
# Run tests migration
#####################
tests_migration:
runs-on: ubuntu-latest
name: Test migration on ${{ matrix.connection }} (PHP ${{ matrix.php-version }})
strategy:
fail-fast: false
matrix:
php-version: ['8.2']
connection: [mysql]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: redis, ${{ matrix.connection }}
coverage: none
- name: Check PHP Version
run: php -v
- name: Check Composer Version
run: composer -V
- name: Check PHP Extensions
run: php -m
# Composer
- name: Validate composer.json and composer.lock
run: composer validate
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
${{ runner.os }}-composer-${{ matrix.php-version }}
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
# Prepare
- name: Prepare environment
run: cp scripts/ci/.env.${{ matrix.connection }} .env
- name: Start mysql
run: sudo systemctl start mysql.service
- name: Create database
run: mysql --protocol=tcp -u root -proot -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
- name: Run migrations
run: php artisan migrate --no-interaction -vvv
- name: Run seeds
run: php artisan db:seed --no-interaction -vvv