[FRAM-156] Allow use of class name to resolve relation #224
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: 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 | |
coverage: none # disable xdebug | |
ini-values: date.timezone=Europe/Paris | |
- name: Check PHP Version | |
run: php -v | |
- name: Shutdown Ubuntu MySQL (SUDO) | |
run: sudo service mysql stop | |
- uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql version: '8.0' | |
mysql root password: 'root' | |
mysql database: 'test' | |
- 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: 'Show MySQL version' | |
run: mysql -h 127.0.0.1 -u root -e 'show variables like "version";' | |
- name: Check sqlite3 version | |
run: sqlite3 --version | |
- 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: '8.0' | |
mysql root password: 'root' | |
mysql database: 'test' | |
- 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 |