From e37038888a6a4c0b83b2f1a5ec045f9148a8a227 Mon Sep 17 00:00:00 2001 From: Guillaume Sainthillier Date: Sat, 28 Sep 2024 13:45:19 +0200 Subject: [PATCH] improve CI by auto generating workflows --- .github/workflows/continuous-integration.yml | 35 ++++++++++++++++++ .github/workflows/cs.yaml | 36 ------------------ .github/workflows/phpstan.yaml | 36 ------------------ .github/workflows/tests.yaml | 39 -------------------- .laminas-ci.json | 16 ++++++++ 5 files changed, 51 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .github/workflows/cs.yaml delete mode 100644 .github/workflows/phpstan.yaml delete mode 100644 .github/workflows/tests.yaml create mode 100644 .laminas-ci.json diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..e8c88220 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,35 @@ +name: "Continuous Integration" + +on: + pull_request: + branches: + - "refs/pull/*" + - "master" + push: + branches: + - "refs/pull/*" + - "master" + +jobs: + matrix: + name: Generate job matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Gather CI configuration + id: matrix + uses: laminas/laminas-ci-matrix-action@v1 + + qa: + name: QA Checks + needs: [matrix] + runs-on: ${{ matrix.operatingSystem }} + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} + steps: + - name: ${{ matrix.name }} + uses: laminas/laminas-continuous-integration-action@v1 + with: + job: ${{ matrix.job }} diff --git a/.github/workflows/cs.yaml b/.github/workflows/cs.yaml deleted file mode 100644 index ff6bce77..00000000 --- a/.github/workflows/cs.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Code Style - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - include: - - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' } - - name: PHP ${{ matrix.php-version }} - - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - coverage: pcov - tools: composer:v2 - - - name: Install dependencies - run: | - composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} - - - name: Check code style - run: | - php vendor/bin/php-cs-fixer --using-cache=no --diff --dry-run --stop-on-violation --verbose fix diff --git a/.github/workflows/phpstan.yaml b/.github/workflows/phpstan.yaml deleted file mode 100644 index 9fe7b688..00000000 --- a/.github/workflows/phpstan.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: PHPStan - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - include: - - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' } - - name: PHP ${{ matrix.php-version }} - - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - coverage: pcov - tools: composer:v2 - - - name: Install dependencies - run: | - composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} - - - name: Analyze code for issues - run: | - php vendor/bin/phpstan analyse src --level 8 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index 47d64072..00000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - include: - - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' } - - { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' } - - { operating-system: 'ubuntu-latest', php-version: '8.3', dependencies: '' } - - - name: PHP ${{ matrix.php-version }} - - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - coverage: pcov - tools: composer:v2 - - - name: Install dependencies - run: | - composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} - - - name: Run tests - run: | - php vendor/bin/phpunit diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 00000000..c360b2e6 --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,16 @@ +{ + "additional_checks": [ + { + "name": "PHPStan", + "job": { + "command": "./vendor/bin/phpstan analyse", + "php": "@lowest" + } + } + ], + "exclude": [ + { + "name": "README Linting [8.1, latest]" + } + ] +}