71bfcd5997
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.6 to 2.1.7. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.6...v2.1.7) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
name: Migration tests
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
branches-ignore: ['l10n_master*']
|
|
release:
|
|
types: [created]
|
|
|
|
workflow_run:
|
|
workflows: ['Compress images']
|
|
types: [completed]
|
|
|
|
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: [7.4]
|
|
connection: [mysql]
|
|
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
|
|
- 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 "::set-output name=dir::$(composer config cache-files-dir)"
|
|
- name: Cache composer files
|
|
uses: actions/cache@v2.1.7
|
|
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
|