BlueGit

projects-timfalken-com microchess

Files

microchess / .gitlab-ci.yml

.gitlab-ci.yml

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