Improve monitoring settings validation #24
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Static and dependency analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Validate Composer metadata | |
| working-directory: plugins/basicrum | |
| run: composer validate --strict | |
| - name: Audit locked dependencies | |
| working-directory: plugins/basicrum | |
| run: composer audit --locked | |
| - name: Install dependencies | |
| working-directory: plugins/basicrum | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Static analysis | |
| working-directory: plugins/basicrum | |
| run: composer analyse | |
| translations: | |
| name: Translation catalogs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - 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@v7 | |
| - 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@v7 | |
| - 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 | |
| release-artifact: | |
| name: Release ZIP smoke test | |
| runs-on: ubuntu-latest | |
| needs: | |
| - quality | |
| - translations | |
| - unit | |
| - integration | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup release PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '7.4' | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Install release tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rsync zip unzip | |
| - name: Build and inspect release artifact | |
| run: sh tools/build-release.sh | |
| - name: Install and test packaged plugin | |
| run: sh tools/smoke-test-release.sh release/basicrum.zip | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: basicrum-release | |
| path: | | |
| release/basicrum.zip | |
| release/basicrum.zip.sha256 | |
| if-no-files-found: error |