Update release workflow to workflow_dispatch-only pattern #18
This file contains hidden or 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: [trunk] | |
| pull_request: | |
| jobs: | |
| phpcs: | |
| name: PHPCS (WordPress + Docs) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '7.4' | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Cache Composer | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/composer | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Composer install | |
| run: composer install --no-progress --prefer-dist --no-interaction | |
| - name: Run PHPCS | |
| run: composer run phpcs | |
| phpunit: | |
| name: PHPUnit (integration, wp-env) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '7.4' | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Cache Composer | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/composer | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Composer install | |
| run: composer install --no-progress --prefer-dist --no-interaction | |
| - name: Install wp-env | |
| run: npm install -g @wordpress/env | |
| - name: Start wp-env | |
| run: wp-env start | |
| - name: Run PHPUnit inside tests container | |
| run: | | |
| wp-env run tests-cli --env-cwd=wp-content/plugins/hey-woo-tests \ | |
| -- php vendor/bin/phpunit --colors=always | |
| - name: Capture wp-env logs on failure | |
| if: failure() | |
| run: wp-env logs tests |