|
7 | 7 | paths-ignore: |
8 | 8 | - "**.md" |
9 | 9 | pull_request: |
| 10 | + |
10 | 11 | # Allow manually triggering the workflow. |
11 | 12 | workflow_dispatch: |
12 | 13 |
|
13 | 14 | jobs: |
14 | 15 | test: |
15 | 16 | name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} |
16 | | - # Ubuntu-20.x includes MySQL 8.0, which causes `caching_sha2_password` issues with PHP < 7.4 |
17 | | - # https://www.php.net/manual/en/mysqli.requirements.php |
18 | | - # TODO: change to ubuntu-latest when we no longer support PHP < 7.4 |
19 | | - runs-on: ubuntu-18.04 |
| 17 | + runs-on: ubuntu-20.04 |
20 | 18 |
|
21 | 19 | env: |
22 | 20 | WP_VERSION: ${{ matrix.wordpress }} |
23 | 21 |
|
24 | 22 | strategy: |
| 23 | + # PHP 7.1 uses PHPUnit 7.5.20 |
| 24 | + # PHP 7.2 uses PHPUnit 8.5.21 |
| 25 | + # PHP 7.3 uses PHPUnit 9.5.10 |
| 26 | + # PHP 7.4 uses PHPUnit 9.5.10 |
| 27 | + # PHP 8.0 uses PHPUnit 9.5.10 |
| 28 | + # PHP 8.1 uses PHPUnit 9.5.10 |
| 29 | + # PHP 8.2 uses PHPUnit 9.5.10 |
| 30 | + # Key: |
| 31 | + # - coverage: Whether to run the tests with code coverage. |
| 32 | + # - experimental: Whether the build is "allowed to fail". |
25 | 33 | matrix: |
26 | | - wordpress: ["5.5", "5.6", "5.7"] |
27 | | - php: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4"] |
| 34 | + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] |
| 35 | + wordpress: ['5.5', '5.6', '5.7', '5.8', '5.9'] |
| 36 | + experimental: [false] |
| 37 | + coverage: [none] |
28 | 38 | include: |
29 | | - - php: "8.0" |
30 | | - # Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above). |
31 | | - composer-options: "--ignore-platform-reqs" |
32 | | - extensions: pcov |
33 | | - ini-values: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\"" |
34 | | - coverage: pcov |
35 | | - exclude: |
36 | | - - php: "8.0" |
37 | | - wordpress: "5.5" |
| 39 | + - php: '7.1' |
| 40 | + wordpress: '5.8.3' |
| 41 | + experimental: false |
| 42 | + coverage: none |
38 | 43 | fail-fast: false |
39 | | - |
| 44 | + continue-on-error: ${{ matrix.experimental }} |
40 | 45 | steps: |
41 | 46 | - name: Checkout code |
42 | | - uses: actions/checkout@v2 |
| 47 | + uses: actions/checkout@v3 |
43 | 48 |
|
44 | 49 | - name: Setup PHP ${{ matrix.php }} |
45 | 50 | uses: shivammathur/setup-php@v2 |
46 | 51 | with: |
47 | 52 | php-version: ${{ matrix.php }} |
48 | 53 | extensions: ${{ matrix.extensions }} |
49 | | - ini-values: ${{ matrix.ini-values }} |
50 | 54 | coverage: ${{ matrix.coverage }} |
51 | 55 |
|
52 | 56 | - name: Setup problem matchers for PHP |
53 | 57 | run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
54 | 58 |
|
55 | | - # Setup PCOV since we're using PHPUnit < 8 which has it integrated. Requires PHP 7.1. |
56 | | - # Ignore platform reqs to make it install on PHP 8. |
57 | | - # https://github.com/krakjoe/pcov-clobber |
58 | | - - name: Setup PCOV |
59 | | - if: ${{ matrix.php == 8.0 }} |
60 | | - run: | |
61 | | - composer require pcov/clobber --ignore-platform-reqs |
62 | | - vendor/bin/pcov clobber |
63 | | -
|
64 | 59 | - name: Setup Problem Matchers for PHPUnit |
65 | 60 | run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
66 | 61 |
|
67 | 62 | - name: Install Composer dependencies |
68 | | - uses: ramsey/composer-install@v1 |
| 63 | + if: ${{ matrix.php < 8.2 }} |
| 64 | + uses: ramsey/composer-install@v2 |
| 65 | + |
| 66 | + - name: Install Composer dependencies for PHP >= 8.2 |
| 67 | + if: ${{ matrix.php >= 8.2 }} |
| 68 | + uses: ramsey/composer-install@v2 |
69 | 69 | with: |
70 | | - composer-options: "${{ matrix.composer-options }}" |
| 70 | + composer-options: --ignore-platform-reqs |
71 | 71 |
|
72 | 72 | - name: Start MySQL Service |
73 | 73 | run: sudo systemctl start mysql.service |
74 | 74 |
|
| 75 | + - name: Setting mysql_native_password for PHP <= 7.3 |
| 76 | + if: ${{ matrix.php <= 7.3 }} |
| 77 | + run: mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';" |
| 78 | + |
75 | 79 | - name: Prepare environment for integration tests |
76 | | - run: composer prepare-ci |
| 80 | + run: composer prepare-ci --no-interaction |
77 | 81 |
|
78 | | - - name: Run integration tests (single site) |
79 | | - if: ${{ matrix.php != 8.0 }} |
80 | | - run: composer test |
81 | | - - name: Run integration tests (single site with code coverage) |
82 | | - if: ${{ matrix.php == 8.0 }} |
83 | | - run: composer coverage-ci |
84 | | - - name: Run integration tests (multisite) |
85 | | - run: composer test-ms |
| 82 | + - name: Run integration tests |
| 83 | + run: composer test --no-interaction |
0 commit comments