BlueGit

projects-timfalken-com microchess

Files

microchess / .gitlab-ci.yml

.gitlab-ci.yml

.gitlab-ci.yml 1.3 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
11 script:
12 - find web -name '*.php' -not -path '*/artifacts/*' -print0 | xargs -0 -n1 php -l
13 - php -r 'foreach (["pdo_sqlite", "curl"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing extension " . $extension); exit(1); } }'
14 - php web/tests/chess.php
15 - python3 web/tests/integration.py
16
17frontend_checks:
18 stage: test
19 image: node:22-bookworm-slim
20 script:
21 - node --check web/assets/app.js
22 - node --check web/tests/browser.mjs
23
24# A real FTP fixture verifies that mirroring preserves production data and secrets.
25deploy_tests:
26 stage: test
27 image: debian:bookworm-slim
28 before_script:
29 - apt-get update -qq
30 - apt-get install -y --no-install-recommends python3 python3-pyftpdlib lftp ca-certificates openssh-client
31 script:
32 - python3 ci/test_deploy.py
33
34ftp_upload:
35 stage: deploy
36 image: debian:bookworm-slim
37 resource_group: production
38 environment:
39 name: production
40 rules:
41 - if: '$CI_COMMIT_BRANCH == "master"'
42 before_script:
43 - apt-get update -qq
44 - apt-get install -y --no-install-recommends python3 lftp ca-certificates openssh-client
45 script:
46 - python3 ci/deploy.py