Refactored the plugin file structure. Added consent loader. Added pag… #1
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: | |
| - main | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| unit: | |
| name: Unit (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['7.4', '8.1', '8.2', '8.3'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Install dependencies | |
| working-directory: plugins/basicrum | |
| run: composer install --no-interaction --prefer-dist | |
| - name: PHP syntax lint | |
| working-directory: plugins/basicrum | |
| run: composer lint:php | |
| - name: Coding standards | |
| working-directory: plugins/basicrum | |
| run: composer lint | |
| - name: Unit tests | |
| working-directory: plugins/basicrum | |
| run: ./vendor/bin/phpunit --configuration phpunit.xml | |
| integration: | |
| name: Integration (PHP ${{ matrix.php }}, WP ${{ matrix.wp }}) | |
| runs-on: ubuntu-latest | |
| needs: unit | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - php: '7.4' | |
| wp: '6.0' | |
| - php: '8.2' | |
| wp: 'trunk' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Install dependencies | |
| working-directory: plugins/basicrum | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Install WP test library (best effort) | |
| continue-on-error: true | |
| run: | | |
| set -e | |
| sudo apt-get update | |
| sudo apt-get install -y subversion | |
| WP_TESTS_DIR=/tmp/wordpress-tests-lib | |
| WP_CORE_DIR=/tmp/wordpress | |
| TESTS_SVN_BASE="https://develop.svn.wordpress.org/${{ matrix.wp }}/tests/phpunit" | |
| CORE_SVN_BASE="https://develop.svn.wordpress.org/${{ matrix.wp }}/src" | |
| mkdir -p "$WP_TESTS_DIR" "$WP_CORE_DIR" | |
| svn export --force --quiet "$TESTS_SVN_BASE/includes" "$WP_TESTS_DIR/includes" || true | |
| svn export --force --quiet "$TESTS_SVN_BASE/data" "$WP_TESTS_DIR/data" || true | |
| svn export --force --quiet "$CORE_SVN_BASE/wp-includes" "$WP_CORE_DIR/wp-includes" || true | |
| svn export --force --quiet "$CORE_SVN_BASE/wp-admin" "$WP_CORE_DIR/wp-admin" || true | |
| - name: Integration tests | |
| working-directory: plugins/basicrum | |
| env: | |
| WP_TESTS_DIR: /tmp/wordpress-tests-lib | |
| run: ./vendor/bin/phpunit --configuration phpunit-with-integration.xml |