Rename development mode to HTTP strictness #13
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: | |
| translations: | |
| name: Translation catalogs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP and WP-CLI | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: wp-cli:2.12.0 | |
| coverage: none | |
| - name: Regenerate translation catalogs | |
| run: sh tools/update-translations.sh plugins/basicrum | |
| - name: Check for stale translation artifacts | |
| run: git diff --exit-code -- plugins/basicrum/languages | |
| 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@v5 | |
| - 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 | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_ROOT_HOST: '%' | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost -proot" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - php: '7.4' | |
| wp: '6.0' | |
| - php: '8.2' | |
| wp: 'trunk' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - 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: Configure MySQL authentication | |
| run: | | |
| docker exec "${{ job.services.mysql.id }}" mysql --protocol=socket --user=root --password=root \ | |
| --execute="ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';" | |
| - name: Install WordPress test library | |
| run: | | |
| set -e | |
| sudo apt-get update | |
| sudo apt-get install -y default-mysql-client subversion | |
| bash tools/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp }} | |
| - name: Integration tests | |
| working-directory: plugins/basicrum | |
| env: | |
| WP_TESTS_DIR: /tmp/wordpress-tests-lib | |
| run: ./vendor/bin/phpunit --configuration phpunit-with-integration.xml |