Skip to content

[FRAM-175] Do not execute query if pivot table is empty on belongs to many #236

[FRAM-175] Do not execute query if pivot table is empty on belongs to many

[FRAM-175] Do not execute query if pivot table is empty on belongs to many #236

Workflow file for this run

name: CI
on:
push:
branches: [ '[1-9].[0-9]+' ]
pull_request:
branches: [ '[1-9].[0-9]+' ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Paris"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json
ini-values: date.timezone=Europe/Paris
- name: Check PHP Version
run: php -v
- uses: mirromutth/mysql-action@v1.1
with:
mysql version: '5.7'
mysql root password: 'root'
- name: Reset mysql password
run: |
# To prevent "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0"
# See: https://github.com/mirromutth/mysql-action/issues/16
sleep 15
cat <<EOF | mysql -h 127.0.0.1 -u root --password=root
UPDATE mysql.user SET authentication_string = null WHERE user = 'root';
FLUSH PRIVILEGES;
EOF
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install dependencies
run: composer install --prefer-dist --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run test suite
run: composer run-script tests
analysis:
name: Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Paris"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: json
ini-values: date.timezone=Europe/Paris
#
# - name: Install Infection
# run: composer global require infection/infection
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run type coverage
run: ./vendor/bin/psalm --shepherd --no-cache --output-format=github
- name: Run psalm usage
run: ./vendor/bin/psalm --no-cache -c tests/StaticAnalysis/psalm.xml
#
# - name: Run Infection
# run: |
# git fetch --depth=1 origin $GITHUB_BASE_REF
# ~/.composer/vendor/bin/infection --logger-github --git-diff-filter=AM
coverage:
name: Test coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Paris"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: json
ini-values: date.timezone=Europe/Paris
- uses: mirromutth/mysql-action@v1.1
with:
mysql version: '5.7'
mysql root password: 'root'
- name: Reset mysql password
run: |
# To prevent "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0"
# See: https://github.com/mirromutth/mysql-action/issues/16
sleep 15
cat <<EOF | mysql -h 127.0.0.1 -u root --password=root
UPDATE mysql.user SET authentication_string = null WHERE user = 'root';
FLUSH PRIVILEGES;
EOF
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test coverage
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage.xml