]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - .gitlab-ci.yml
Create an usable tool for local hash testing
[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   - export CC="gcc -pipe"
12
13   - >
14     if wget -nv https://beta.xonotic.org/pipeline-bin/gmqcc ; then
15       export QCC="$PWD/gmqcc"
16       chmod +x "$QCC"
17     else
18       git clone --depth=1 --branch=main https://gitlab.com/xonotic/gmqcc.git gmqcc
19       make -C gmqcc || exit 1
20       export QCC="$PWD/gmqcc/gmqcc"
21     fi
22
23   # Makefile: don't complain about lack of tags (fetching them is slow)
24   - export QCCFLAGS_WATERMARK=gitlab_pipeline
25   # Makefile: don't compress anything or complain about lack of zip program
26   - export ZIP=/bin/true
27
28 test_compilation_units:
29   rules:
30     - changes:
31       - qcsrc/**/*
32   stage: test
33   script:
34     - make test
35
36 test_sv_game:
37   stage: test
38   script:
39     - export EXPECT=210a5126bffa3cd2acdb8d62bcec9e11
40     - qcsrc/tools/sv_game-hashtest.sh
41     - exit $?
42
43
44 # NOTE: The generated docs are incomplete - they don't contain code behind SVQC CSQC MENUQC GAMEQC ifdefs.
45 # With them added to PREDEFINED, it would take over half an hour to generate the docs and even then
46 # they might not be complete. Doxygen doesn't handle #elif and might not understand some QC definitions.
47 #doxygen:  # rename to 'pages' when gitlab.com allows pages to exceed 100MiB
48 #  before_script:
49 #    - ln -s $PWD data/xonotic-data.pk3dir # is this needed?
50 #    - apt-get update
51 #    - apt-get -y install doxygen graphviz
52 #  stage: deploy
53 #  script:
54 #    - cd qcsrc && doxygen
55 #    - mv html ../public
56 #    - mkdir -p ~/.ssh
57 #    - for i in {0..0}; do eval $(printf "echo \$id_rsa_%02d\n" $i) >> ~/.ssh/id_rsa_base64; done
58 #    - base64 --decode ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
59 #    - chmod 600 ~/.ssh/id_rsa
60 #    - echo -e "Host *\n\tStrictHostKeyChecking no\n\tLogLevel ERROR\n" >> ~/.ssh/config
61 #    - git config --global user.name "Gitlab CI"
62 #    - git config --global user.email "<>"
63 #    - git clone --single-branch --depth 1 ${DEPLOY_HOST}:${DEPLOY_REPO} ~/deploy_
64 #    - mkdir ~/deploy && mv ~/deploy_/.git ~/deploy && rm -r ~/deploy_
65 #    - cp -r ../public/* ~/deploy
66 #    - cd ~/deploy && git add -A . && git commit -m "Deploy ${CI_BUILD_REF}" && git push origin gh-pages
67 #  artifacts:
68 #    paths:
69 #      - public
70 #  only:
71 #    - master