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