chore(wpgraphql-logging): test against WordPress 6.9 #488
Workflow file for this run
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
| # This does the following: | |
| # 1. Detects modified plugins that have codeception.dist.yml configuration setup | |
| # 2. Runs Codeception tests on those plugins using the custom action | |
| # 3. Creates a matrix job for each plugin that has a quality configuration | |
| # Bonus: This means you can have plugin specific badges e.g. | |
| # [](https://github.com/wpengine/hwptoolkit/actions) | |
| name: Testing Integration | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'plugins/*/**.php' | |
| pull_request: | |
| paths: | |
| - 'plugins/*/**.php' | |
| # Cancel previous workflow run groups that have not completed. | |
| concurrency: | |
| # Group workflow runs by workflow name, along with the head branch ref of the pull request | |
| # or otherwise the branch or tag ref. | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-plugins: | |
| runs-on: ubuntu-latest | |
| name: Detect plugins with test config | |
| outputs: | |
| plugins: ${{ steps.detect.outputs.plugins }} | |
| has-plugins: ${{ steps.detect.outputs.has-plugins }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get changed plugin directory | |
| id: plugin | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| bash .github/scripts/get_plugin_slug.sh main | |
| else | |
| bash .github/scripts/get_plugin_slug.sh \ | |
| ${{ github.event.pull_request.base.sha }} \ | |
| ${{ github.event.pull_request.head.sha }} | |
| fi | |
| - name: Detect changed plugins with quality config | |
| id: detect | |
| run: | | |
| if [ -z "${{ steps.plugin.outputs.slug }}" ]; then | |
| echo "No plugin slug detected" | |
| echo "plugins=[]" >> $GITHUB_OUTPUT | |
| echo "has-plugins=false" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| PLUGIN="${{ steps.plugin.outputs.slug }}" | |
| if [ -f "plugins/$PLUGIN/codeception.dist.yml" ]; then | |
| echo "plugins=[\"$PLUGIN\"]" >> $GITHUB_OUTPUT | |
| echo "has-plugins=true" >> $GITHUB_OUTPUT | |
| echo "✅ Found codeception.dist.yml for plugin: $PLUGIN" | |
| else | |
| echo "plugins=[]" >> $GITHUB_OUTPUT | |
| echo "has-plugins=false" >> $GITHUB_OUTPUT | |
| echo "ℹ️ No codeception.dist.yml found for plugin: $PLUGIN, skipping automated tests" | |
| fi | |
| continuous_integration: | |
| needs: detect-plugins | |
| if: needs.detect-plugins.outputs.has-plugins == 'true' | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.plugin }} integration tests (WP ${{ matrix.wordpress }}, PHP ${{ matrix.php }}) | |
| strategy: | |
| matrix: | |
| plugin: ${{ fromJson(needs.detect-plugins.outputs.plugins) }} | |
| php: ["8.3","8.2","8.1"] | |
| wordpress: ["6.9","6.8","6.7"] | |
| include: | |
| - php: "8.2" | |
| wordpress: "6.9" | |
| coverage: 1 | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: ${{ matrix.plugin }} codeception tests | |
| uses: ./.github/actions/codeception | |
| with: | |
| working-directory: plugins/${{ matrix.plugin }} | |
| php: ${{ matrix.php }} | |
| wordpress: ${{ matrix.wordpress }} | |
| extensions: json,mbstring |