chore: fix ci deprecations, bump github actions #69
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: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
php-cs-fixer: | |
name: PHP-CS-Fixer | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- '8.1' | |
- '8.2' | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: intl, bcmath, curl, openssl, mbstring | |
ini-values: memory_limit=-1 | |
tools: pecl, composer, php-cs-fixer | |
coverage: none | |
- name: Run PHP-CS-Fixer fix | |
run: php-cs-fixer fix --dry-run --diff --ansi | |
phpstan: | |
name: PHPStan | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- '8.1' | |
- '8.2' | |
fail-fast: false | |
env: | |
APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: intl, bcmath, curl, openssl, mbstring | |
ini-values: memory_limit=-1 | |
tools: pecl, composer, phpstan | |
coverage: none | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Update project dependencies | |
run: composer update --no-interaction --no-progress --ansi | |
- name: Cache PHPStan results | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/phpstan | |
key: phpstan-php${{ matrix.php }}-${{ github.sha }} | |
restore-keys: | | |
phpstan-php${{ matrix.php }}- | |
phpstan- | |
continue-on-error: true | |
- name: Run PHPStan analysis | |
run: phpstan analyse --no-interaction --no-progress --no-interaction --ansi | |
atoum: | |
name: Atoum | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- '8.1' | |
- '8.2' | |
fail-fast: false | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: pecl, composer | |
extensions: intl, bcmath, curl, openssl, mbstring | |
coverage: pcov | |
ini-values: memory_limit=-1 | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Update project dependencies | |
run: composer update --no-interaction --no-progress --ansi | |
- name: Run tests | |
run: ./bin/atoum | |
# See https://github.com/SeleniumHQ/selenium/issues/9044 | |
behat: | |
name: Behat | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- '8.1' | |
profile: | |
- 'default' | |
- 'symfony2' | |
fail-fast: false | |
env: | |
DISPLAY: ':99' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: pecl, composer | |
extensions: intl, bcmath, curl, openssl, mbstring | |
coverage: pcov | |
ini-values: memory_limit=-1,display_errors=1,error_reporting=-1 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: '8' | |
- name: Run Selenium | |
run: | | |
wget "https://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.1.jar" -O selenium.jar | |
java -jar selenium.jar -debug &> /dev/null & | |
- name: Run PHP fixtures server | |
run: php -S localhost:8080 -t tests/fixtures/www &> /dev/null & | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Update project dependencies | |
run: composer update --no-interaction --no-progress --ansi | |
- name: Wait for browser & PHP to start | |
run: | | |
while ! nc -z localhost 4444 </dev/null; do echo Waiting for Selenium to start...; sleep 1; done | |
while ! nc -z localhost 8080 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done | |
timeout-minutes: 1 | |
- name: Run behat tests | |
run: ./bin/behat -fprogress --no-interaction --profile=${{ matrix.profile }} |