|
18 | 18 | - 'pyproject.toml'
|
19 | 19 | workflow_dispatch:
|
20 | 20 |
|
| 21 | +env: |
| 22 | + APP_NAME: cloud_py_api |
| 23 | + |
21 | 24 | jobs:
|
22 | 25 | analysis:
|
23 | 26 | runs-on: macos-12
|
@@ -46,3 +49,271 @@ jobs:
|
46 | 49 |
|
47 | 50 | - name: Run Analysis
|
48 | 51 | run: pre-commit run --all-files --verbose --show-diff-on-failure
|
| 52 | + |
| 53 | + tests-pgsql: |
| 54 | + needs: [analysis] |
| 55 | + runs-on: ubuntu-22.04 |
| 56 | + name: ${{ matrix.nextcloud }} • PHP ${{ matrix.php-version }} • PgSQL ${{ matrix.pgsql-version }} |
| 57 | + if: "!contains(github.event.head_commit.message, '[docs]')" |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + nextcloud: [ "25.0.2" ] |
| 62 | + php-version: [ "7.4", "8.0" ] |
| 63 | + pgsql-version: [ "13", "14", "15" ] |
| 64 | + |
| 65 | + services: |
| 66 | + postgres: |
| 67 | + image: postgres:${{ matrix.pgsql-version }} |
| 68 | + env: |
| 69 | + POSTGRES_USER: root |
| 70 | + POSTGRES_PASSWORD: rootpassword |
| 71 | + POSTGRES_DB: nextcloud |
| 72 | + options: >- |
| 73 | + --health-cmd pg_isready |
| 74 | + --health-interval 10s |
| 75 | + --health-timeout 5s |
| 76 | + --health-retries 5 |
| 77 | + ports: |
| 78 | + - 5432:5432 |
| 79 | + |
| 80 | + steps: |
| 81 | + - name: Set up php ${{ matrix.php-version }} |
| 82 | + uses: shivammathur/setup-php@v2 |
| 83 | + with: |
| 84 | + php-version: ${{ matrix.php-version }} |
| 85 | + extensions: mbstring, fileinfo, intl, pdo_pgsql, zip, gd |
| 86 | + |
| 87 | + - uses: actions/setup-python@v4 |
| 88 | + with: |
| 89 | + python-version: '3.9' |
| 90 | + |
| 91 | + - name: cache-nextcloud |
| 92 | + id: nextcloud_setup |
| 93 | + uses: actions/cache@v3 |
| 94 | + with: |
| 95 | + path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 96 | + key: ${{ matrix.nextcloud }} |
| 97 | + |
| 98 | + - name: Download Nextcloud |
| 99 | + if: steps.nextcloud_setup.outputs.cache-hit != 'true' |
| 100 | + run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 101 | + |
| 102 | + - name: Set up Nextcloud |
| 103 | + run: | |
| 104 | + tar -xjf nextcloud-${{ matrix.nextcloud }}.tar.bz2 --strip-components 1 |
| 105 | + mkdir data |
| 106 | + php occ maintenance:install --verbose --database=pgsql --database-name=nextcloud \ |
| 107 | + --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \ |
| 108 | + --admin-user admin --admin-pass adminpassword |
| 109 | + php occ config:system:set debug --value=true --type=boolean |
| 110 | + php -S localhost:8080 & |
| 111 | +
|
| 112 | + - uses: actions/checkout@v3 |
| 113 | + with: |
| 114 | + path: apps/${{ env.APP_NAME }} |
| 115 | + |
| 116 | + - name: Enable App |
| 117 | + run: php occ app:enable ${{ env.APP_NAME }} |
| 118 | + |
| 119 | + - name: Generate coverage report |
| 120 | + working-directory: apps/${{ env.APP_NAME }} |
| 121 | + run: | |
| 122 | + python3 -m pip -v install ".[dev]" |
| 123 | + coverage run -m pytest -s && coverage xml && coverage html |
| 124 | + env: |
| 125 | + SERVER_ROOT: "../.." |
| 126 | + CPA_LOGLEVEL: debug |
| 127 | + |
| 128 | + - name: HTML coverage to artifacts |
| 129 | + uses: actions/upload-artifact@v3 |
| 130 | + with: |
| 131 | + name: coverage_${{ matrix.nextcloud }}_${{ matrix.php-version }}_${{ matrix.pgsql-version }} |
| 132 | + path: apps/${{ env.APP_NAME }}/htmlcov |
| 133 | + if-no-files-found: error |
| 134 | + |
| 135 | + - name: Upload report to Codecov |
| 136 | + uses: codecov/codecov-action@v3 |
| 137 | + with: |
| 138 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 139 | + file: apps/${{ env.APP_NAME }}/coverage.xml |
| 140 | + fail_ci_if_error: true |
| 141 | + verbose: true |
| 142 | + |
| 143 | + tests-mysql: |
| 144 | + needs: [analysis] |
| 145 | + runs-on: ubuntu-22.04 |
| 146 | + name: ${{ matrix.nextcloud }} • PHP ${{ matrix.php-version }} • MySQL ${{ matrix.mysql-version }} |
| 147 | + if: "!contains(github.event.head_commit.message, '[docs]')" |
| 148 | + strategy: |
| 149 | + fail-fast: false |
| 150 | + matrix: |
| 151 | + nextcloud: [ "25.0.2" ] |
| 152 | + php-version: [ "7.4", "8.0" ] |
| 153 | + mysql-version: [ "8" ] |
| 154 | + |
| 155 | + services: |
| 156 | + mysql: |
| 157 | + image: mysql:${{ matrix.mysql-version }} |
| 158 | + env: |
| 159 | + MYSQL_ROOT_PASSWORD: rootpassword |
| 160 | + MYSQL_DATABASE: nextcloud |
| 161 | + options: >- |
| 162 | + --health-cmd mysqladmin ping |
| 163 | + --health-interval 10s |
| 164 | + --health-timeout 5s |
| 165 | + --health-retries 5 |
| 166 | + ports: |
| 167 | + - 3306:3306 |
| 168 | + |
| 169 | + steps: |
| 170 | + - name: Set up php ${{ matrix.php-version }} |
| 171 | + uses: shivammathur/setup-php@v2 |
| 172 | + with: |
| 173 | + php-version: ${{ matrix.php-version }} |
| 174 | + extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd |
| 175 | + |
| 176 | + - uses: actions/setup-python@v4 |
| 177 | + with: |
| 178 | + python-version: '3.9' |
| 179 | + |
| 180 | + - name: cache-nextcloud |
| 181 | + id: nextcloud_setup |
| 182 | + uses: actions/cache@v3 |
| 183 | + with: |
| 184 | + path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 185 | + key: ${{ matrix.nextcloud }} |
| 186 | + |
| 187 | + - name: Download Nextcloud |
| 188 | + if: steps.nextcloud_setup.outputs.cache-hit != 'true' |
| 189 | + run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 190 | + |
| 191 | + - name: Set up Nextcloud |
| 192 | + run: | |
| 193 | + tar -xjf nextcloud-${{ matrix.nextcloud }}.tar.bz2 --strip-components 1 |
| 194 | + mkdir data |
| 195 | + php occ maintenance:install --verbose --database=mysql --database-name=nextcloud \ |
| 196 | + --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \ |
| 197 | + --admin-user admin --admin-pass adminpassword |
| 198 | + php occ config:system:set debug --value=true --type=boolean |
| 199 | + php -S localhost:8080 & |
| 200 | +
|
| 201 | + - uses: actions/checkout@v3 |
| 202 | + with: |
| 203 | + path: apps/${{ env.APP_NAME }} |
| 204 | + |
| 205 | + - name: Enable App |
| 206 | + run: php occ app:enable ${{ env.APP_NAME }} |
| 207 | + |
| 208 | + - name: Generate coverage report |
| 209 | + working-directory: apps/${{ env.APP_NAME }} |
| 210 | + run: | |
| 211 | + python3 -m pip -v install ".[dev]" |
| 212 | + coverage run -m pytest -s && coverage xml && coverage html |
| 213 | + env: |
| 214 | + SERVER_ROOT: "../.." |
| 215 | + CPA_LOGLEVEL: debug |
| 216 | + |
| 217 | + - name: HTML coverage to artifacts |
| 218 | + uses: actions/upload-artifact@v3 |
| 219 | + with: |
| 220 | + name: coverage_${{ matrix.nextcloud }}_${{ matrix.php-version }}_${{ matrix.mysql-version }} |
| 221 | + path: apps/${{ env.APP_NAME }}/htmlcov |
| 222 | + if-no-files-found: error |
| 223 | + |
| 224 | + - name: Upload report to Codecov |
| 225 | + uses: codecov/codecov-action@v3 |
| 226 | + with: |
| 227 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 228 | + file: apps/${{ env.APP_NAME }}/coverage.xml |
| 229 | + fail_ci_if_error: true |
| 230 | + verbose: true |
| 231 | + |
| 232 | + tests-mariadb: |
| 233 | + needs: [analysis] |
| 234 | + runs-on: ubuntu-22.04 |
| 235 | + name: ${{ matrix.nextcloud }} • PHP ${{ matrix.php-version }} • Maria ${{ matrix.mariadb-version }} |
| 236 | + if: "!contains(github.event.head_commit.message, '[docs]')" |
| 237 | + strategy: |
| 238 | + fail-fast: false |
| 239 | + matrix: |
| 240 | + nextcloud: [ "25.0.2" ] |
| 241 | + php-version: [ "7.4", "8.0" ] |
| 242 | + mariadb-version: [ "10.3", "10.6", "10.10" ] |
| 243 | + |
| 244 | + services: |
| 245 | + mariadb: |
| 246 | + image: mariadb:${{ matrix.mariadb-version }} |
| 247 | + env: |
| 248 | + MARIADB_ROOT_PASSWORD: rootpassword |
| 249 | + MYSQL_DATABASE: nextcloud |
| 250 | + options: >- |
| 251 | + --health-cmd mysqladmin ping |
| 252 | + --health-interval 10s |
| 253 | + --health-timeout 5s |
| 254 | + --health-retries 5 |
| 255 | + ports: |
| 256 | + - 3306:3306 |
| 257 | + |
| 258 | + steps: |
| 259 | + - name: Set up php ${{ matrix.php-version }} |
| 260 | + uses: shivammathur/setup-php@v2 |
| 261 | + with: |
| 262 | + php-version: ${{ matrix.php-version }} |
| 263 | + extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd |
| 264 | + |
| 265 | + - uses: actions/setup-python@v4 |
| 266 | + with: |
| 267 | + python-version: '3.9' |
| 268 | + |
| 269 | + - name: cache-nextcloud |
| 270 | + id: nextcloud_setup |
| 271 | + uses: actions/cache@v3 |
| 272 | + with: |
| 273 | + path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 274 | + key: ${{ matrix.nextcloud }} |
| 275 | + |
| 276 | + - name: Download Nextcloud |
| 277 | + if: steps.nextcloud_setup.outputs.cache-hit != 'true' |
| 278 | + run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 |
| 279 | + |
| 280 | + - name: Set up Nextcloud |
| 281 | + run: | |
| 282 | + tar -xjf nextcloud-${{ matrix.nextcloud }}.tar.bz2 --strip-components 1 |
| 283 | + mkdir data |
| 284 | + php occ maintenance:install --verbose --database=mysql --database-name=nextcloud \ |
| 285 | + --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \ |
| 286 | + --admin-user admin --admin-pass adminpassword |
| 287 | + php occ config:system:set debug --value=true --type=boolean |
| 288 | + php -S localhost:8080 & |
| 289 | +
|
| 290 | + - uses: actions/checkout@v3 |
| 291 | + with: |
| 292 | + path: apps/${{ env.APP_NAME }} |
| 293 | + |
| 294 | + - name: Enable App |
| 295 | + run: php occ app:enable ${{ env.APP_NAME }} |
| 296 | + |
| 297 | + - name: Generate coverage report |
| 298 | + working-directory: apps/${{ env.APP_NAME }} |
| 299 | + run: | |
| 300 | + python3 -m pip -v install ".[dev]" |
| 301 | + coverage run -m pytest -s && coverage xml && coverage html |
| 302 | + env: |
| 303 | + SERVER_ROOT: "../.." |
| 304 | + CPA_LOGLEVEL: debug |
| 305 | + |
| 306 | + - name: HTML coverage to artifacts |
| 307 | + uses: actions/upload-artifact@v3 |
| 308 | + with: |
| 309 | + name: coverage_${{ matrix.nextcloud }}_${{ matrix.php-version }}_${{ matrix.mariadb-version }} |
| 310 | + path: apps/${{ env.APP_NAME }}/htmlcov |
| 311 | + if-no-files-found: error |
| 312 | + |
| 313 | + - name: Upload report to Codecov |
| 314 | + uses: codecov/codecov-action@v3 |
| 315 | + with: |
| 316 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 317 | + file: apps/${{ env.APP_NAME }}/coverage.xml |
| 318 | + fail_ci_if_error: true |
| 319 | + verbose: true |
0 commit comments