From fe04310913a332d17ac1dc32c23e22f11880aa7a Mon Sep 17 00:00:00 2001 From: David Herrera Date: Wed, 13 Sep 2023 00:01:47 -0400 Subject: [PATCH] Use centralized GitHub workflows --- .github/workflows/code-quality.yml | 14 ++++++++++ .github/workflows/coding-standards.yml | 14 ++++++++++ .github/workflows/cs.yml | 38 -------------------------- .github/workflows/tests.yml | 17 ------------ .github/workflows/unit-test.yml | 21 ++++++++++++++ 5 files changed, 49 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/code-quality.yml create mode 100644 .github/workflows/coding-standards.yml delete mode 100644 .github/workflows/cs.yml delete mode 100644 .github/workflows/tests.yml create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..0a04bc7 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,14 @@ +name: Code Quality + +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + code-quality: + if: github.event.pull_request.draft == false + uses: alleyinteractive/.github/.github/workflows/php-code-quality.yml@main + with: + php: 8.1 diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 0000000..641da10 --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,14 @@ +name: Coding Standards + +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + coding-standards: + if: github.event.pull_request.draft == false + uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main + with: + php: 8.1 diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml deleted file mode 100644 index b121273..0000000 --- a/.github/workflows/cs.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Coding Standards - -on: - pull_request: - -jobs: - cs: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [ 8.1 ] - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} - - - name: Check out code - uses: actions/checkout@v3 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - - - name: Install composer dependencies - uses: ramsey/composer-install@v2 - - - name: Run PHPCS - run: composer run-script phpcs - - - name: Run PHP-CS-Fixer - run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no --allow-risky=yes - - - name: Run PHPStan - run: composer run-script phpstan diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index b0aaebe..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Tests - -on: - pull_request: - -jobs: - phpunit: - strategy: - matrix: - php: [ 8.2, 8.1 ] - wordpress: [ "latest" ] - multisite: [ false, true ] - uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main - with: - php: ${{ matrix.php }} - wordpress: ${{ matrix.wordpress }} - multisite: ${{ matrix.multisite }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..8fa7bda --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,21 @@ +name: Testing Suite + +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + php-tests: + if: github.event.pull_request.draft == false + strategy: + matrix: + php: [8.2, 8.1] + wordpress: ["latest"] + multisite: [false, true] + uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main + with: + php: ${{ matrix.php }} + wordpress: ${{ matrix.wordpress }} + multisite: ${{ matrix.multisite }}