| 1 | stages: |
| 2 | - test |
| 3 | - deploy |
| 4 | |
| 5 | php_tests: |
| 6 | stage: test |
| 7 | image: php:8.3-cli-bookworm |
| 8 | before_script: |
| 9 | - apt-get update -qq |
| 10 | - apt-get install -y --no-install-recommends python3 libonig-dev |
| 11 | - docker-php-ext-install mbstring |
| 12 | script: |
| 13 | - find web -name '*.php' -not -path '*/artifacts/*' -print0 | xargs -0 -n1 php -l |
| 14 | - php -r 'foreach (["pdo_sqlite", "curl", "mbstring", "openssl"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing extension " . $extension); exit(1); } }' |
| 15 | - php web/tests/chess.php |
| 16 | - php web/tests/colors.php |
| 17 | - php web/tests/feedback.php |
| 18 | - php web/tests/push.php |
| 19 | - python3 web/tests/startup.py |
| 20 | - python3 web/tests/integration.py |
| 21 | |
| 22 | frontend_checks: |
| 23 | stage: test |
| 24 | image: node:22-bookworm-slim |
| 25 | script: |
| 26 | - node --check web/assets/app.js |
| 27 | - node --check web/assets/pwa.js |
| 28 | - node --check web/sw.js |
| 29 | - node web/tests/pwa.mjs |
| 30 | - node --check web/tests/browser.mjs |
| 31 | |
| 32 | # A real FTP fixture verifies that mirroring preserves production data and secrets. |
| 33 | deploy_tests: |
| 34 | stage: test |
| 35 | image: debian:bookworm-slim |
| 36 | before_script: |
| 37 | - apt-get update -qq |
| 38 | - apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client |
| 39 | script: |
| 40 | - python3 ci/test_deploy.py |
| 41 | |
| 42 | ftp_upload: |
| 43 | stage: deploy |
| 44 | image: debian:bookworm-slim |
| 45 | resource_group: production |
| 46 | environment: |
| 47 | name: production |
| 48 | rules: |
| 49 | - if: '$CI_COMMIT_BRANCH == "master"' |
| 50 | before_script: |
| 51 | - apt-get update -qq |
| 52 | - apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client |
| 53 | script: |
| 54 | - python3 ci/deploy.py |
projects-timfalken-com microchess