|
| 1 | +name: tests-for-mysql8 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - "**.php" |
| 7 | + - ".github/workflows/tests-for-laravel-versions.yml" |
| 8 | + - ".github/workflows/tests-for-sql-databases.yml" |
| 9 | + - "phpunit.xml.dist" |
| 10 | + - "composer.json" |
| 11 | + - "composer.lock" |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + mysql_8: |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + |
| 18 | + services: |
| 19 | + mysql: |
| 20 | + image: mysql:8 |
| 21 | + env: |
| 22 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 23 | + MYSQL_DATABASE: laravel |
| 24 | + ports: |
| 25 | + - 3306:3306 |
| 26 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 27 | + |
| 28 | + strategy: |
| 29 | + fail-fast: true |
| 30 | + |
| 31 | + name: MySQL 8 |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Setup PHP |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + php-version: 8.2 |
| 41 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr |
| 42 | + tools: composer:v2 |
| 43 | + coverage: none |
| 44 | + |
| 45 | + - name: Set Framework version |
| 46 | + run: composer config version "11.x-dev" |
| 47 | + |
| 48 | + - name: Install dependencies |
| 49 | + uses: nick-fields/retry@v3 |
| 50 | + with: |
| 51 | + timeout_minutes: 5 |
| 52 | + max_attempts: 5 |
| 53 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 54 | + |
| 55 | + - name: Execute tests |
| 56 | + run: vendor/bin/phpunit |
| 57 | + env: |
| 58 | + DB_CONNECTION: mysql |
| 59 | + mysql_57: |
| 60 | + runs-on: ubuntu-24.04 |
| 61 | + |
| 62 | + services: |
| 63 | + mysql: |
| 64 | + image: mysql:5.7 |
| 65 | + env: |
| 66 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 67 | + MYSQL_DATABASE: laravel |
| 68 | + ports: |
| 69 | + - 3306:3306 |
| 70 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 71 | + |
| 72 | + strategy: |
| 73 | + fail-fast: true |
| 74 | + |
| 75 | + name: MySQL 5.7 |
| 76 | + |
| 77 | + steps: |
| 78 | + - name: Checkout code |
| 79 | + uses: actions/checkout@v4 |
| 80 | + |
| 81 | + - name: Setup PHP |
| 82 | + uses: shivammathur/setup-php@v2 |
| 83 | + with: |
| 84 | + php-version: 8.2 |
| 85 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr |
| 86 | + tools: composer:v2 |
| 87 | + coverage: none |
| 88 | + |
| 89 | + - name: Set Framework version |
| 90 | + run: composer config version "11.x-dev" |
| 91 | + |
| 92 | + - name: Install dependencies |
| 93 | + uses: nick-fields/retry@v3 |
| 94 | + with: |
| 95 | + timeout_minutes: 5 |
| 96 | + max_attempts: 5 |
| 97 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 98 | + |
| 99 | + - name: Execute tests |
| 100 | + run: vendor/bin/phpunit |
| 101 | + env: |
| 102 | + DB_CONNECTION: mysql |
| 103 | + DB_COLLATION: utf8mb4_unicode_ci |
| 104 | + |
| 105 | + mssql: |
| 106 | + runs-on: ubuntu-20.04 |
| 107 | + |
| 108 | + services: |
| 109 | + sqlsrv: |
| 110 | + image: mcr.microsoft.com/mssql/server:2019-latest |
| 111 | + env: |
| 112 | + ACCEPT_EULA: Y |
| 113 | + SA_PASSWORD: Forge123 |
| 114 | + ports: |
| 115 | + - 1433:1433 |
| 116 | + |
| 117 | + strategy: |
| 118 | + fail-fast: true |
| 119 | + |
| 120 | + name: SQL Server 2019 |
| 121 | + |
| 122 | + steps: |
| 123 | + - name: Checkout code |
| 124 | + uses: actions/checkout@v4 |
| 125 | + |
| 126 | + - name: Setup PHP |
| 127 | + uses: shivammathur/setup-php@v2 |
| 128 | + with: |
| 129 | + php-version: 8.2 |
| 130 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc, :php-psr |
| 131 | + tools: composer:v2 |
| 132 | + coverage: none |
| 133 | + |
| 134 | + - name: Set Framework version |
| 135 | + run: composer config version "11.x-dev" |
| 136 | + |
| 137 | + - name: Install dependencies |
| 138 | + run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 139 | + |
| 140 | + - name: Wait for SQL Server to be ready |
| 141 | + run: | |
| 142 | + echo "Waiting for SQL Server to start..." |
| 143 | + for i in {1..30}; do |
| 144 | + /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Forge123 -Q "SELECT 1" && break |
| 145 | + echo "SQL Server is starting up..." |
| 146 | + sleep 2 |
| 147 | + done |
| 148 | +
|
| 149 | + - name: Execute tests |
| 150 | + run: vendor/bin/phpunit |
| 151 | + env: |
| 152 | + DB_CONNECTION: sqlsrv |
| 153 | + DB_HOST: localhost |
| 154 | + DB_PORT: 1433 |
| 155 | + DB_DATABASE: master |
| 156 | + DB_USERNAME: SA |
| 157 | + DB_PASSWORD: Forge123 |
| 158 | + |
| 159 | + mariadb: |
| 160 | + runs-on: ubuntu-24.04 |
| 161 | + |
| 162 | + services: |
| 163 | + mariadb: |
| 164 | + image: mariadb:10 |
| 165 | + env: |
| 166 | + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes |
| 167 | + MARIADB_DATABASE: laravel |
| 168 | + ports: |
| 169 | + - 3306:3306 |
| 170 | + options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 171 | + |
| 172 | + strategy: |
| 173 | + fail-fast: true |
| 174 | + |
| 175 | + name: MariaDB 10 |
| 176 | + |
| 177 | + steps: |
| 178 | + - name: Checkout code |
| 179 | + uses: actions/checkout@v4 |
| 180 | + |
| 181 | + - name: Setup PHP |
| 182 | + uses: shivammathur/setup-php@v2 |
| 183 | + with: |
| 184 | + php-version: 8.2 |
| 185 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr |
| 186 | + tools: composer:v2 |
| 187 | + coverage: none |
| 188 | + |
| 189 | + - name: Set Framework version |
| 190 | + run: composer config version "11.x-dev" |
| 191 | + |
| 192 | + - name: Install dependencies |
| 193 | + uses: nick-fields/retry@v3 |
| 194 | + with: |
| 195 | + timeout_minutes: 5 |
| 196 | + max_attempts: 5 |
| 197 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 198 | + |
| 199 | + - name: Execute tests |
| 200 | + run: vendor/bin/phpunit |
| 201 | + env: |
| 202 | + DB_CONNECTION: mariadb |
| 203 | + |
| 204 | + pgsql: |
| 205 | + runs-on: ubuntu-24.04 |
| 206 | + |
| 207 | + services: |
| 208 | + postgresql: |
| 209 | + image: postgres:14 |
| 210 | + env: |
| 211 | + POSTGRES_DB: laravel |
| 212 | + POSTGRES_USER: forge |
| 213 | + POSTGRES_PASSWORD: password |
| 214 | + ports: |
| 215 | + - 5432:5432 |
| 216 | + options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 |
| 217 | + |
| 218 | + strategy: |
| 219 | + fail-fast: true |
| 220 | + |
| 221 | + name: PostgreSQL 14 |
| 222 | + |
| 223 | + steps: |
| 224 | + - name: Checkout code |
| 225 | + uses: actions/checkout@v4 |
| 226 | + |
| 227 | + - name: Setup PHP |
| 228 | + uses: shivammathur/setup-php@v2 |
| 229 | + with: |
| 230 | + php-version: 8.2 |
| 231 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, :php-psr |
| 232 | + tools: composer:v2 |
| 233 | + coverage: none |
| 234 | + |
| 235 | + - name: Set Framework version |
| 236 | + run: composer config version "11.x-dev" |
| 237 | + |
| 238 | + - name: Install dependencies |
| 239 | + uses: nick-fields/retry@v3 |
| 240 | + with: |
| 241 | + timeout_minutes: 5 |
| 242 | + max_attempts: 5 |
| 243 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 244 | + |
| 245 | + - name: Execute tests |
| 246 | + run: vendor/bin/phpunit |
| 247 | + env: |
| 248 | + DB_CONNECTION: pgsql |
| 249 | + DB_USERNAME: forge |
| 250 | + DB_PASSWORD: password |
| 251 | + |
0 commit comments