BlueGit

projects-timfalken-com microchess

Files

microchess / .gitlab-ci.yml

.gitlab-ci.yml

.gitlab-ci.yml 1.6 KiB Download Raw
1stages:
2 - test
3 - deploy
4
5php_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/feedback.php
17 - php web/tests/push.php
18 - python3 web/tests/startup.py
19 - python3 web/tests/integration.py
20
21frontend_checks:
22 stage: test
23 image: node:22-bookworm-slim
24 script:
25 - node --check web/assets/app.js
26 - node --check web/assets/pwa.js
27 - node --check web/sw.js
28 - node web/tests/pwa.mjs
29 - node --check web/tests/browser.mjs
30
31# A real FTP fixture verifies that mirroring preserves production data and secrets.
32deploy_tests:
33 stage: test
34 image: debian:bookworm-slim
35 before_script:
36 - apt-get update -qq
37 - apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client
38 script:
39 - python3 ci/test_deploy.py
40
41ftp_upload:
42 stage: deploy
43 image: debian:bookworm-slim
44 resource_group: production
45 environment:
46 name: production
47 rules:
48 - if: '$CI_COMMIT_BRANCH == "master"'
49 before_script:
50 - apt-get update -qq
51 - apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client
52 script:
53 - python3 ci/deploy.py