Fix UsersController dependency pulls to avoid "accessed before init" … #701
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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
on: | |
- pull_request | |
- push | |
name: "Continuous Integration" | |
jobs: | |
dependency-analysis: | |
name: "Dependency Analysis" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- 8.2 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP with extensions" | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: "gd, intl, json, mbstring, pdo" | |
- name: "Cache dependencies installed with composer" | |
uses: actions/[email protected] | |
with: | |
path: ~/.composer/cache | |
key: php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
php-${{ matrix.php-version }}-composer-locked- | |
- name: "Install dependencies with composer" | |
run: $(which composer) install | |
- name: "Run dependency analysis with composer-require-checker" | |
run: vendor/bin/composer-require-checker --config-file=composer-require-checker.json | |
static-analysis: | |
name: "Static Analysis" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- 8.2 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP with extensions" | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-version }} | |
pecl: true | |
extensions: "gd, intl, json, mbstring, pdo" | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache | |
key: php-${{ matrix.php-version }}-composer-locked${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
php-${{ matrix.php-version }}-composer-locked | |
- name: "Install dependencies with composer" | |
run: $(which composer) install | |
- name: "Run static analysis with phpstan" | |
run: vendor/bin/phpstan analyze --configuration=phpstan.neon | |
tests: | |
name: "Tests" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- 8.2 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP with extensions" | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: "gd, intl, json, mbstring, pdo" | |
coverage: "xdebug" | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache | |
key: php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
php-${{ matrix.php-version }}-composer-locked- | |
- name: "Install dependencies with composer" | |
run: $(which composer) install | |
- name: "Create build directory" | |
run: mkdir -p build | |
- name: "Copy configuration" | |
run: cp src/config.php.dist src/config.php | |
- name: "Dump Xdebug filter with phpunit" | |
run: vendor/bin/phpunit --dump-xdebug-filter=build/xdebug-filter.php | |
- name: "Fix unknown constant with xdebug3" | |
run: sed -i 's/XDEBUG_PATH_WHITELIST/XDEBUG_PATH_INCLUDE/g' build/xdebug-filter.php | |
- name: "Run tests with phpunit" | |
run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --coverage-text --prepend=build/xdebug-filter.php | |
- name: "Download code coverage uploader for Codecov.io" | |
run: curl -s https://codecov.io/bash -o codecov | |
- name: "Send code coverage report to Codecov.io" | |
run: bash codecov -t ${{ secrets.CODECOV_TOKEN }} | |
# Disabled until code covereage up to 100% | |
#mutation-test: | |
# name: "Mutation Tests" | |
# | |
# runs-on: ubuntu-latest | |
# | |
# strategy: | |
# matrix: | |
# php-version: | |
# - 8.2 | |
# | |
# steps: | |
# - name: "Checkout" | |
# uses: actions/checkout@master | |
# | |
# - name: "Install PHP with extensions" | |
# uses: shivammathur/setup-php@master | |
# with: | |
# php-version: ${{ matrix.php-version }} | |
# extensions: intl, json, pdo, xdebug | |
# coverage: "xdebug" | |
# | |
# - name: "Cache dependencies installed with composer" | |
# uses: actions/cache@v1 | |
# with: | |
# path: ~/.composer/cache | |
# key: php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }} | |
# restore-keys: | | |
# php-${{ matrix.php-version }}-composer-locked- | |
# | |
# - name: "Install dependencies with composer" | |
# run: $(which composer) install | |
# | |
# - name: "Create build directory" | |
# run: mkdir -p build/infection | |
# | |
# - name: "Copy configuration" | |
# run: cp src/config.php.dist src/config.php | |
# | |
# - name: "Run mutation tests with infection" | |
# run: vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=69 --min-msi=19 |