BlueGit

projects-timfalken-com microchess

Files

microchess / .gitlab-ci.yml

.gitlab-ci.yml

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