]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - .gitlab-ci.yml
Fix an obscure bug causing QC physics-driven projectiles to sit on kill triggers...
[xonotic/xonotic-data.pk3dir.git] / .gitlab-ci.yml
1 workflow:\r
2   rules:\r
3     - if: $CI_COMMIT_MESSAGE =~ /Transifex autosync/\r
4       when: never\r
5     - when: always\r
6 \r
7 before_script:\r
8   - ln -s $PWD data/xonotic-data.pk3dir\r
9 \r
10   - git clone --depth=1 --branch=main https://gitlab.com/xonotic/gmqcc.git gmqcc\r
11   - cd gmqcc && make -j $(nproc) && export QCC="$PWD/gmqcc"\r
12   - cd ..\r
13 \r
14 test_compilation_units:\r
15   rules:\r
16     - changes:\r
17       - qcsrc/**/*\r
18   stage: test\r
19   script:\r
20     - ./qcsrc/tools/compilationunits.sh\r
21 \r
22 test_sv_game:\r
23   stage: test\r
24   script:\r
25     - git clone --depth=1 --branch=div0-stable https://gitlab.com/xonotic/darkplaces.git darkplaces\r
26     - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"\r
27     - cd ..\r
28 \r
29     - mkdir -p data/maps\r
30     - wget -O data/stormkeep.pk3 http://beta.xonotic.org/autobuild-bsp/latest/stormkeep.pk3\r
31     - wget -O data/maps/stormkeep.mapinfo https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.mapinfo\r
32     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
33     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
34     - make\r
35     - EXPECT=f48f0950921140f6133c866bcc6e9d79\r
36     - HASH=$(${ENGINE} -noconfig -nohome +timestamps 1 +exec serverbench.cfg\r
37       | tee /dev/stderr\r
38       | sed -e 's,^\[[^]]*\] ,,'\r
39       | grep '^:'\r
40       | grep -v '^:gamestart:'\r
41       | grep -v '^:anticheat:'\r
42       | md5sum | awk '{ print $1 }')\r
43     - echo 'expected:' $EXPECT\r
44     - echo '  actual:' $HASH\r
45     - test "$HASH" == "$EXPECT"\r
46     - exit $?\r
47 \r
48 test_sv_unit:\r
49   stage: test\r
50   script:\r
51     - git clone --depth=1 --branch=div0-stable https://gitlab.com/xonotic/darkplaces.git darkplaces\r
52     - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"\r
53     - cd ..\r
54 \r
55     - mkdir maps && wget -O maps/gitlab-ci.bsp https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/_init/_init.bsp\r
56     - make\r
57     - while read line; do\r
58         echo $line;\r
59         if [[ $line == "All tests OK" ]]; then exit 0; fi;\r
60       done < <(${ENGINE} +developer 1 +map gitlab-ci +sv_cmd runtest +exit)\r
61     - exit 1\r
62 \r
63 # NOTE: The generated docs are incomplete - they don't contain code behind SVQC CSQC MENUQC GAMEQC ifdefs.\r
64 # With them added to PREDEFINED, it would take over half an hour to generate the docs and even then\r
65 # they might not be complete. Doxygen doesn't handle #elif and might not understand some QC definitions.\r
66 doxygen:  # rename to 'pages' when gitlab.com allows pages to exceed 100MiB\r
67   before_script:\r
68     - ln -s $PWD data/xonotic-data.pk3dir # is this needed?\r
69     - apt-get update\r
70     - apt-get -y install doxygen graphviz\r
71   stage: deploy\r
72   script:\r
73     - cd qcsrc && doxygen\r
74     - mv html ../public\r
75     - mkdir -p ~/.ssh\r
76     - for i in {0..0}; do eval $(printf "echo \$id_rsa_%02d\n" $i) >> ~/.ssh/id_rsa_base64; done\r
77     - base64 --decode ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa\r
78     - chmod 600 ~/.ssh/id_rsa\r
79     - echo -e "Host *\n\tStrictHostKeyChecking no\n\tLogLevel ERROR\n" >> ~/.ssh/config\r
80     - git config --global user.name "Gitlab CI"\r
81     - git config --global user.email "<>"\r
82     - git clone --single-branch --depth 1 ${DEPLOY_HOST}:${DEPLOY_REPO} ~/deploy_\r
83     - mkdir ~/deploy && mv ~/deploy_/.git ~/deploy && rm -r ~/deploy_\r
84     - cp -r ../public/* ~/deploy\r
85     - cd ~/deploy && git add -A . && git commit -m "Deploy ${CI_BUILD_REF}" && git push origin gh-pages\r
86   artifacts:\r
87     paths:\r
88       - public\r
89   only:\r
90     - master\r