]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - .gitlab-ci.yml
Cleanup: further split default columns layout and move the space separator to the...
[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 test_compilation_units:
9   stage: test
10   script:
11     - ./qcsrc/tools/compilationunits.sh
12
13 test_sv_game:
14   stage: test
15   script:
16     - git clone --depth=1 --branch=master https://gitlab.com/xonotic/darkplaces.git darkplaces
17     - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"
18     - cd ..
19
20     - wget -O data/g-23.pk3 http://beta.xonotic.org/autobuild-bsp/latest/g-23.pk3
21     - make
22     - EXPECT=07fdfd9a19025920a599995730eb2a78
23     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
24       | tee /dev/stderr
25       | grep '^:'
26       | grep -v '^:gamestart:'
27       | grep -v '^:anticheat:'
28       | md5sum | awk '{ print $1 }')
29     - echo 'expected:' $EXPECT
30     - echo '  actual:' $HASH
31     - test "$HASH" == "$EXPECT"
32     - exit $?
33
34 test_sv_unit:
35   stage: test
36   script:
37     - git clone --depth=1 --branch=master https://gitlab.com/xonotic/darkplaces.git darkplaces
38     - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"
39     - cd ..
40
41     - mkdir maps && wget -O maps/gitlab-ci.bsp https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/_init/_init.bsp
42     - make
43     - while read line; do
44         echo $line;
45         if [[ $line == "All tests OK" ]]; then exit 0; fi;
46       done < <(${ENGINE} +developer 1 +map gitlab-ci +sv_cmd runtest +exit)
47     - exit 1
48
49 doxygen:  # rename to 'pages' when gitlab.com allows pages to exceed 100MiB
50   stage: deploy
51   script:
52     - cd qcsrc && doxygen
53     - mv html ../public
54     - for i in {0..0}; do eval $(printf "echo \$id_rsa_%02d\n" $i) >> ~/.ssh/id_rsa_base64; done
55     - base64 --decode ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
56     - chmod 600 ~/.ssh/id_rsa
57     - echo -e "Host *\n\tStrictHostKeyChecking no\n\tLogLevel ERROR\n" >> ~/.ssh/config
58     - git config --global user.name "Gitlab CI"
59     - git config --global user.email "<>"
60     - git clone --single-branch --depth 1 ${DEPLOY_HOST}:${DEPLOY_REPO} ~/deploy_
61     - mkdir ~/deploy && mv ~/deploy_/.git ~/deploy && rm -r ~/deploy_
62     - cp -r ../public/* ~/deploy
63     - cd ~/deploy && git add -A . && git commit -m "Deploy ${CI_BUILD_REF}" && git push origin gh-pages
64   artifacts:
65     paths:
66       - public
67   only:
68     - master