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