chore: modernize JS stack #145
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: | |
types: [opened, synchronize, reopened, ready_for_review] | |
env: | |
PHPUNIT_FLAGS: -v | |
COMPOSER_MEMORY_LIMIT: -1 | |
PHP_VERSION_DEFAULT: 8.1 | |
NODE_VERSION: 20.x | |
jobs: | |
static_analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION_DEFAULT }} | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: pnpm/action-setup@v2 | |
- run: composer validate --strict | |
- run: composer install --prefer-dist --no-interaction --no-progress | |
- run: composer ecs@ci | |
- run: composer phpstan | |
- run: composer rector@ci | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm lint:check | |
- run: pnpm format:check | |
- run: pnpm test | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# Minimum supported dependencies with the latest and oldest PHP version | |
- PHP_VERSION: 8.1 | |
COMPOSER_FLAGS: --prefer-stable --prefer-lowest | |
# Test the latest stable release | |
- PHP_VERSION: 8.1 | |
- PHP_VERSION: 8.2 | |
- PHP_VERSION: 8.3 | |
COVERAGE: true | |
PHPUNIT_FLAGS: --coverage-text | |
# Test specific Symfony versions | |
- PHP_VERSION: 8.1 | |
SYMFONY_VERSION: 5.* # Last 5.x version | |
- PHP_VERSION: 8.2 | |
SYMFONY_VERSION: 5.4.* # Last 5.4.x version | |
- PHP_VERSION: 8.3 | |
SYMFONY_VERSION: 5.4.* # Last 5.4.x version | |
- PHP_VERSION: 8.1 | |
SYMFONY_VERSION: 6.4.* # Last 6.1.x version | |
- PHP_VERSION: 8.2 | |
SYMFONY_VERSION: 6.4.* # Last 6.1.x version | |
- PHP_VERSION: 8.3 | |
SYMFONY_VERSION: 6.4.* # Last 6.1.x version | |
- PHP_VERSION: 8.2 | |
SYMFONY_VERSION: 7.0.* # Last 7.0.x version | |
- PHP_VERSION: 8.3 | |
SYMFONY_VERSION: 7.0.* # Last 7.0.x version | |
#- PHP_VERSION: 8.2 | |
# SYMFONY_VERSION: 7.1.* # Last 7.0.x version | |
#- PHP_VERSION: 8.3 | |
# SYMFONY_VERSION: 7.1.* # Last 7.0.x version | |
# Test the latest Symfony development version with the latest PHP version | |
- PHP_VERSION: 8.3 | |
SYMFONY_VERSION: 7.* # Last 7.x version | |
STABILITY: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.config.PHP_VERSION }} | |
coverage: ${{ matrix.config.COVERAGE }} | |
- name: Install globally Symfony Flex | |
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex | |
- name: Enable Symfony Flex plugin | |
run: composer global config --no-plugins allow-plugins.symfony/flex true | |
- name: Configure Composer minimum stability | |
if: matrix.config.STABILITY | |
run: composer config minimum-stability ${{ matrix.config.STABILITY }} | |
- name: Limit to specific Symfony version | |
if: matrix.config.SYMFONY_VERSION | |
run: echo "SYMFONY_REQUIRE=${{ matrix.config.SYMFONY_VERSION }}" >> $GITHUB_ENV | |
# Remove PSR-7 related things which are only needed for Cypress. | |
- run: | | |
rm fixtures/applications/Symfony/config/packages/nyholm_psr7.yaml | |
rm fixtures/applications/Symfony/config/packages/psr_http_message_bridge.yaml | |
composer remove --dev symfony/psr7-pack | |
- name: Install composer dependencies | |
run: composer update ${{ matrix.config.COMPOSER_FLAGS }} --prefer-dist --no-interaction --no-progress | |
- name: Run PHPUnit | |
run: composer phpunit -- ${{ matrix.config.PHPUNIT_FLAGS }} | |
- name: Run Behat | |
run: composer behat | |
cypress: | |
runs-on: ubuntu-latest | |
name: cypress | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION_DEFAULT }} | |
coverage: none | |
extensions: ctype, iconv, intl | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: pnpm/action-setup@v2 | |
- run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Run Cypress | |
uses: cypress-io/github-action@v6 | |
with: | |
start: composer server-start |