Migrate commands to use AsCommand attribute #2009
Workflow file for this run
This file contains hidden or 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
on: | |
pull_request: | |
branches-ignore: gh-pages | |
push: | |
branches: | |
- main | |
name: build | |
permissions: | |
contents: read | |
jobs: | |
phpcs: | |
name: Code style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
ini-values: memory_limit=-1, date.timezone='UTC' | |
tools: phpcs | |
- name: Check production code style | |
run: composer cs-prod | |
- name: Check test code style | |
run: composer cs-tests | |
linux: | |
name: PHP ${{ matrix.php }}-${{ matrix.os }}-${{ matrix.mode }} | |
env: | |
extensions: curl, mbstring, openssl, pdo, pdo_sqlite | |
SYMFONY_DEPRECATIONS_HELPER: weak | |
COMPOSER_ROOT_VERSION: 5.0.99 | |
COLUMNS: 120 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
php: ['8.2', '8.3', '8.4'] | |
mode: ['stable', 'experimental'] | |
exclude: | |
- php: '8.2' | |
mode: 'experimental' | |
- php: '8.3' | |
mode: 'experimental' | |
- php: '8.4' | |
mode: 'experimental' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ env.extensions }} | |
ini-values: memory_limit=-1, date.timezone='UTC' | |
coverage: xdebug | |
tools: composer:v2 | |
- name: Determine composer cache directory | |
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | |
- name: Cache dependencies installed with composer | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php${{ matrix.php }}-${{ matrix.mode }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
php${{ matrix.php }}-${{ matrix.mode }}-composer- | |
- name: Update composer | |
run: composer self-update | |
- name: Validate composer.json | |
run: composer validate | |
- name: Install latest versions of dependencies in stable mode | |
if: matrix.mode == 'stable' | |
run: composer update --no-interaction --no-progress --optimize-autoloader --ansi | |
- name: Composer install lowest versions of dependencies on PHP 8.2 in experimental mode | |
if: matrix.php == '8.2' && matrix.mode == 'experimental' | |
run: composer update --prefer-lowest --no-interaction --no-progress --optimize-autoloader --ansi | |
- name: Test that failing test really fails | |
run: if php codecept run -c tests/data/claypit/ scenario FailedCept -vvv; then echo "Test hasn't failed"; false; fi; | |
# - name: Run tests without code coverage on PHP 8.2 | |
# if: matrix.php == '8.2' | |
# run: | | |
# php -S 127.0.0.1:8008 -t tests/data/app >/dev/null 2>&1 & | |
# php codecept build | |
# php codecept run cli,unit | |
- name: Run tests | |
run: | | |
php -S 127.0.0.1:8008 -t tests/data/app -d pcov.directory=$(pwd)/tests/data/app >/dev/null 2>&1 & | |
php codecept build | |
php codecept run cli,unit,coverage --env COVERAGE=1 | |
- name: Run module-asserts tests | |
run: php codecept run -c vendor/codeception/module-asserts/ | |
- name: Run module-filesystem tests | |
run: php codecept run -c vendor/codeception/module-filesystem/ | |
- name: Run module-db sqlite tests | |
run: php codecept run -c vendor/codeception/module-db/ unit :Sqlite | |
- name: Run module-phpbrowser tests | |
run: | | |
cd vendor/codeception/module-phpbrowser/ | |
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 & | |
php -S 127.0.0.1:8010 -t tests/data/rest >/dev/null 2>&1 & | |
php ../../../codecept run tests/unit/Codeception/Module/PhpBrowserTest.php | |
windows-latest: | |
name: PHP ${{ matrix.php }}-${{ matrix.os }} | |
env: | |
extensions: curl, mbstring, openssl, pdo, pdo_sqlite | |
SYMFONY_DEPRECATIONS_HELPER: weak | |
COMPOSER_ROOT_VERSION: 5.0.99 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
php: ['8.2', '8.3', '8.4'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ env.extensions }} | |
ini-values: memory_limit=-1, date.timezone='UTC' | |
tools: composer:v2 | |
- name: Determine composer cache directory | |
run: echo "COMPOSER_CACHE_DIR=~\\AppData\\Local\\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Cache dependencies installed with composer | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
php${{ matrix.php }}-composer- | |
- name: Update composer | |
run: composer self-update | |
- name: Validate composer.json | |
run: composer validate | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | |
- name: Run CLI tests | |
run: php codecept run cli --skip-group coverage | |
- name: Run unit tests | |
run: php codecept run unit -g core -g appveyor |