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