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