diff --git a/.github/workflows/check-readme.yaml b/.github/workflows/check-readme.yaml new file mode 100644 index 00000000..76f2144c --- /dev/null +++ b/.github/workflows/check-readme.yaml @@ -0,0 +1,24 @@ +name: Check README.md is in sync + +on: + pull_request: + push: + branches: [ master ] + +jobs: + # Fail CI if repo is in dirty state after bin/update_readme + update-readme: + name: bin/update_readme + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist + + - name: Check status + run: ./bin/update_readme && git diff --exit-code README.md diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c321fe91..065f7738 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,49 +1,26 @@ -name: Bundle CI +name: CI + on: - push: - branches: ['main'] - pull_request: - schedule: - - cron: '0 */12 * * *' + pull_request: ~ + push: + branches: ['main'] + schedule: + - cron: '0 */12 * * *' jobs: + test: + uses: SymfonyCasts/.github/.github/workflows/phpunit.yaml@main + with: + php-version-matrix: '["7.4", "8.0", "8.1", "8.2"]' + php-version-lowest: '7.4' - tests: - name: "Tests ${{ matrix.php-version }} ${{ matrix.dependency-versions }} deps ${{ matrix.dependency-versions }}" - runs-on: ubuntu-18.04 - - strategy: - fail-fast: false - matrix: - # normal, highest, non-dev installs - php-version: ['7.4', '8.0', '8.1', '8.2'] - composer-options: ['--prefer-stable'] - dependency-versions: ['highest'] - include: - # testing lowest php with lowest dependencies - - php-version: '7.4' - dependency-versions: 'lowest' - composer-options: '--prefer-lowest' - # testing dev versions with highest PHP - - php-version: '8.0' - dependency-versions: 'highest' - composer-options: '' # allow dev deps - - steps: - - name: "Checkout code" - uses: "actions/checkout@v2" + composer-validate: + uses: SymfonyCasts/.github/.github/workflows/composer-validate.yaml@main - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" + cs: + uses: SymfonyCasts/.github/.github/workflows/php-cs-fixer.yaml@main - - name: "Composer install" - uses: "ramsey/composer-install@v1" + sca: + uses: SymfonyCasts/.github/.github/workflows/phpstan.yaml@main with: - dependency-versions: "${{ matrix.dependency-versions }}" - composer-options: "--prefer-dist --no-progress" - - - name: Run PHPUnit tests - run: "SYMFONY_PHPUNIT_VERSION=${{ matrix.phpunit-version }} ./vendor/bin/simple-phpunit" + php: '8.0' diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml deleted file mode 100644 index ac940135..00000000 --- a/.github/workflows/static-analysis.yaml +++ /dev/null @@ -1,70 +0,0 @@ -name: Code style and static analysis - -on: - pull_request: - push: - branches: [ master ] - -jobs: - composer-validate: - name: Validate composer.json - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.0.0 - - - name: Validate - run: composer validate --no-check-lock --strict - - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - - name: Install PHP-CS-Fixer - run: composer global require friendsofphp/php-cs-fixer --prefer-dist --no-progress - - - name: Run script - run: $HOME/.composer/vendor/bin/php-cs-fixer fix --verbose --diff --dry-run - - phpstan: - name: PHPStan - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - - - name: Install dependencies - run: composer install - - - name: Run script - run: vendor/bin/phpstan analyse - - # Fail CI if repo is in dirty state after bin/update_readme - update-readme: - name: bin/update_readme - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - - - name: Install dependencies - run: composer install - - - name: Check Status - run: ./bin/update_readme && git diff --exit-code README.md diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c1760f25..ea29f09d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -15,7 +15,7 @@ - + ./tests