|
10 | 10 | fail-fast: false
|
11 | 11 | matrix:
|
12 | 12 | php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
|
13 |
| - runs-on: ubuntu-latest |
| 13 | + runs-on: ubuntu-20.04 |
14 | 14 |
|
15 | 15 | steps:
|
16 | 16 | - name: Check out source code
|
@@ -58,35 +58,55 @@ jobs:
|
58 | 58 | run: composer phpunit
|
59 | 59 |
|
60 | 60 | functional: #----------------------------------------------------------------------
|
61 |
| - name: Functional - WP ${{ matrix.wp }} on PHP ${{ matrix.php }} |
| 61 | + name: Functional - WP ${{ matrix.wp }} on PHP ${{ matrix.php }} with MySQL ${{ matrix.mysql }} |
62 | 62 | strategy:
|
63 | 63 | fail-fast: false
|
64 | 64 | matrix:
|
65 |
| - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] |
| 65 | + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] |
66 | 66 | wp: ['latest']
|
| 67 | + mysql: ['8.0'] |
67 | 68 | test: ["composer behat || composer behat-rerun"]
|
68 | 69 | include:
|
69 | 70 | - php: '5.6'
|
70 | 71 | wp: 'trunk'
|
| 72 | + mysql: '8.0' |
| 73 | + test: "composer behat || composer behat-rerun" |
| 74 | + - php: '5.6' |
| 75 | + wp: 'trunk' |
| 76 | + mysql: '5.7' |
| 77 | + test: "composer behat || composer behat-rerun" |
| 78 | + - php: '5.6' |
| 79 | + wp: 'trunk' |
| 80 | + mysql: '5.6' |
71 | 81 | test: "composer behat || composer behat-rerun"
|
72 | 82 | - php: '7.4'
|
73 | 83 | wp: 'trunk'
|
| 84 | + mysql: '8.0' |
| 85 | + test: "composer behat || composer behat-rerun" |
| 86 | + - php: '8.0' |
| 87 | + wp: 'trunk' |
| 88 | + mysql: '8.0' |
| 89 | + test: "composer behat || composer behat-rerun" |
| 90 | + - php: '8.0' |
| 91 | + wp: 'trunk' |
| 92 | + mysql: '5.7' |
| 93 | + test: "composer behat || composer behat-rerun" |
| 94 | + - php: '8.0' |
| 95 | + wp: 'trunk' |
| 96 | + mysql: '5.6' |
74 | 97 | test: "composer behat || composer behat-rerun"
|
75 | 98 | - php: '5.6'
|
76 | 99 | wp: '3.7'
|
77 |
| - test: "composer behat || composer behat-rerun || true" |
78 |
| - runs-on: ubuntu-latest |
| 100 | + mysql: '5.6' |
| 101 | + test: "composer behat || composer behat-rerun" |
| 102 | + runs-on: ubuntu-20.04 |
79 | 103 |
|
80 | 104 | services:
|
81 | 105 | mysql:
|
82 |
| - image: mysql:5.7 |
83 |
| - env: |
84 |
| - MYSQL_DATABASE: wp_cli_test |
85 |
| - MYSQL_USER: root |
86 |
| - MYSQL_ROOT_PASSWORD: root |
| 106 | + image: mysql:${{ matrix.mysql }} |
87 | 107 | ports:
|
88 | 108 | - 3306
|
89 |
| - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 109 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wp_cli_test --entrypoint sh mysql:${{ matrix.mysql }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" |
90 | 110 |
|
91 | 111 | steps:
|
92 | 112 | - name: Check out source code
|
|
99 | 119 | files: "composer.json, behat.yml"
|
100 | 120 |
|
101 | 121 | - name: Set up PHP envirnoment
|
| 122 | + if: steps.check_files.outputs.files_exists == 'true' |
102 | 123 | uses: shivammathur/setup-php@v2
|
103 | 124 | with:
|
104 | 125 | php-version: '${{ matrix.php }}'
|
@@ -127,20 +148,25 @@ jobs:
|
127 | 148 |
|
128 | 149 | - name: Start MySQL server
|
129 | 150 | if: steps.check_files.outputs.files_exists == 'true'
|
130 |
| - run: sudo service mysql start |
| 151 | + run: sudo systemctl start mysql |
131 | 152 |
|
132 |
| - - name: Prepare test database |
| 153 | + - name: Configure DB environment |
133 | 154 | if: steps.check_files.outputs.files_exists == 'true'
|
134 | 155 | run: |
|
135 |
| - export MYQSL_HOST=127.0.0.1 |
| 156 | + export MYSQL_HOST=127.0.0.1 |
136 | 157 | export MYSQL_TCP_PORT=${{ job.services.mysql.ports['3306'] }}
|
137 |
| - mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot -proot |
138 |
| - mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"127.0.0.1" IDENTIFIED BY "password1"' -uroot -proot |
139 |
| - mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test_scaffold.* TO "wp_cli_test"@"127.0.0.1" IDENTIFIED BY "password1"' -uroot -proot |
| 158 | + echo "WP_CLI_TEST_DBROOTUSER=root" >> $GITHUB_ENV |
| 159 | + echo "WP_CLI_TEST_DBROOTPASS=root" >> $GITHUB_ENV |
| 160 | + echo "WP_CLI_TEST_DBUSER=wp_cli_test" >> $GITHUB_ENV |
| 161 | + echo "WP_CLI_TEST_DBPASS=password1" >> $GITHUB_ENV |
| 162 | + echo "WP_CLI_TEST_DBHOST=$MYSQL_HOST:$MYSQL_TCP_PORT" >> $GITHUB_ENV |
| 163 | +
|
| 164 | + - name: Prepare test database |
| 165 | + if: steps.check_files.outputs.files_exists == 'true' |
| 166 | + run: composer prepare-tests |
140 | 167 |
|
141 | 168 | - name: Run Behat
|
142 | 169 | if: steps.check_files.outputs.files_exists == 'true'
|
143 | 170 | env:
|
144 | 171 | WP_VERSION: '${{ matrix.wp }}'
|
145 | 172 | run: ${{ matrix.test }}
|
146 |
| - |
|
0 commit comments