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