]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - .gitlab-ci.yml
Add a new bot skill level for extremely tough bots
[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   - export MAKEFLAGS=-j$(nproc); echo MAKEFLAGS=$MAKEFLAGS\r
11 #   FIXME: -march=native -mtune=native _changes the hash_, why?!?\r
12 # - export CC="gcc -pipe -march=native -mtune=native"\r
13   - export CC="gcc -pipe"\r
14 \r
15   - >\r
16     if wget -nv https://beta.xonotic.org/pipeline-bin/gmqcc ; then\r
17       export QCC="$PWD/gmqcc"\r
18       chmod +x "$QCC"\r
19     else\r
20       git clone --depth=1 --branch=main https://gitlab.com/xonotic/gmqcc.git gmqcc\r
21       make -C gmqcc || exit 1\r
22       export QCC="$PWD/gmqcc/gmqcc"\r
23     fi\r
24 \r
25   # Makefile: don't complain about lack of tags (fetching them is slow)\r
26   - export QCCFLAGS_WATERMARK=gitlab_pipeline\r
27   # Makefile: don't compress anything or complain about lack of zip program\r
28   - export ZIP=/bin/true\r
29 \r
30 test_compilation_units:\r
31   rules:\r
32     - changes:\r
33       - qcsrc/**/*\r
34   stage: test\r
35   script:\r
36     - make test\r
37 \r
38 test_sv_game:\r
39   stage: test\r
40   script:\r
41     - >\r
42       if wget -nv https://beta.xonotic.org/pipeline-bin/xonotic-linux64-dedicated ; then\r
43         export ENGINE="$PWD/xonotic-linux64-dedicated"\r
44         chmod +x "$ENGINE"\r
45       else\r
46         git clone --depth=1 --branch=div0-stable https://gitlab.com/xonotic/darkplaces.git darkplaces\r
47         make -C darkplaces sv-release || exit 1\r
48         export ENGINE="$PWD/darkplaces/darkplaces-dedicated -xonotic"\r
49       fi\r
50     - export ENGINE="$ENGINE -noconfig -nohome"\r
51 \r
52     - make qc || exit 1\r
53 \r
54     - mkdir -p data/maps\r
55     - wget -nv -O data/maps/_init.bsp https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/_init/_init.bsp\r
56 \r
57     - while read LINE; do\r
58         echo $LINE;\r
59         [ "$LINE" = "All tests OK" ] && PASS=1;\r
60       done < <(${ENGINE} +developer 1 +map _init +sv_cmd runtest +wait +quit)\r
61     - test "$PASS" = "1" || { echo 'sv_cmd runtest failed!'; exit 1; }\r
62 \r
63     - ${ENGINE} +map _init +sv_cmd dumpnotifs +wait +quit\r
64     - diff notifications.cfg data/data/notifications_dump.cfg ||\r
65         { echo 'Please update notifications.cfg using `dumpnotifs`!'; exit 1; }\r
66 \r
67 #    - wget -nv -O data/stormkeep.pk3 http://beta.xonotic.org/autobuild-bsp/latest/stormkeep.pk3\r
68 # ^^ INCORRECT: /latest/stormkeep.pk3 is the most recently built, not necessarily the one built from master!\r
69 # we can't get the one from master directly as there's no /stable/stormkeep.pk3 or /master/stormkeep.pk3\r
70 # and we can't run misc/tools/xonotic-map-compiler-autobuild as it uses commit hashes from xonotic-maps.pk3dir to generate filenames\r
71 # but the autobuild server can run it and provide us the resulting pk3:\r
72     - wget -nv -O data/stormkeep.pk3 https://beta.xonotic.org/pipeline-bin/stormkeep.pk3\r
73 # see also: misc/infrastructure/xonotic-release-build.cron\r
74     - wget -nv -O data/maps/stormkeep.mapinfo https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.mapinfo\r
75     - wget -nv -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
76     - wget -nv -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
77 \r
78     - EXPECT=20c9c4ea0364fbb611656cc0b876e02b\r
79     - HASH=$(${ENGINE} +exec serverbench.cfg\r
80       | tee /dev/stderr\r
81       | grep '^:'\r
82       | grep -v '^:gamestart:'\r
83       | grep -v '^:anticheat:'\r
84       | md5sum | awk '{ print $1 }')\r
85     - echo 'expected:' $EXPECT\r
86     - echo '  actual:' $HASH\r
87     - test "$HASH" == "$EXPECT"\r
88     - exit $?\r
89 \r
90 \r
91 # NOTE: The generated docs are incomplete - they don't contain code behind SVQC CSQC MENUQC GAMEQC ifdefs.\r
92 # With them added to PREDEFINED, it would take over half an hour to generate the docs and even then\r
93 # they might not be complete. Doxygen doesn't handle #elif and might not understand some QC definitions.\r
94 #doxygen:  # rename to 'pages' when gitlab.com allows pages to exceed 100MiB\r
95 #  before_script:\r
96 #    - ln -s $PWD data/xonotic-data.pk3dir # is this needed?\r
97 #    - apt-get update\r
98 #    - apt-get -y install doxygen graphviz\r
99 #  stage: deploy\r
100 #  script:\r
101 #    - cd qcsrc && doxygen\r
102 #    - mv html ../public\r
103 #    - mkdir -p ~/.ssh\r
104 #    - for i in {0..0}; do eval $(printf "echo \$id_rsa_%02d\n" $i) >> ~/.ssh/id_rsa_base64; done\r
105 #    - base64 --decode ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa\r
106 #    - chmod 600 ~/.ssh/id_rsa\r
107 #    - echo -e "Host *\n\tStrictHostKeyChecking no\n\tLogLevel ERROR\n" >> ~/.ssh/config\r
108 #    - git config --global user.name "Gitlab CI"\r
109 #    - git config --global user.email "<>"\r
110 #    - git clone --single-branch --depth 1 ${DEPLOY_HOST}:${DEPLOY_REPO} ~/deploy_\r
111 #    - mkdir ~/deploy && mv ~/deploy_/.git ~/deploy && rm -r ~/deploy_\r
112 #    - cp -r ../public/* ~/deploy\r
113 #    - cd ~/deploy && git add -A . && git commit -m "Deploy ${CI_BUILD_REF}" && git push origin gh-pages\r
114 #  artifacts:\r
115 #    paths:\r
116 #      - public\r
117 #  only:\r
118 #    - master\r