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