chiark / gitweb /
Merge branch 'master' into 'master'
[fdroidserver.git] / .gitlab-ci.yml
1
2 test:
3   image: registry.gitlab.com/fdroid/ci-images-server:latest
4   script:
5     - pip3 install -e .
6     - cd tests
7     - ./complete-ci-tests
8
9 # Test that the parsing of the .txt format didn't change from last
10 # released version. This uses the commit ID of the release tags,
11 # rather than the release tag itself so that contributor forks do not
12 # need to include the tags in them for this test to work.
13 #
14 # The COMMIT_ID should be bumped after each release, so that the list
15 # of sed hacks needed does not continuously grow.
16 metadata_v0:
17   image: registry.gitlab.com/fdroid/ci-images-server:latest
18   variables:
19     RELEASE_COMMIT_ID: 2f563f533b3571c80f7a09c6fbb453398658f723  # 1.0.2
20   script:
21     - git fetch https://gitlab.com/fdroid/fdroidserver $RELEASE_COMMIT_ID
22     - cd tests
23     - export GITCOMMIT=`git describe`
24     - git checkout $RELEASE_COMMIT_ID
25     - cd ..
26     - git clone --depth 1 https://gitlab.com/fdroid/fdroiddata
27     - cd fdroiddata
28     - ../tests/dump_internal_metadata_format.py
29     - cd ..
30     - git reset --hard
31     - git checkout $GITCOMMIT
32     - cd fdroiddata
33     - ../tests/dump_internal_metadata_format.py
34     - sed -i
35           -e '/Translation:/d'
36           -e '/kivy:\sfalse/d'
37           -e '/timeout:\s/d'
38           metadata/dump_*/*.yaml
39     - diff -uw metadata/dump_*
40
41 debian_testing:
42   image: debian:testing
43   only:
44     - master@fdroid/fdroidserver
45   script:
46     - apt-get -qy update
47     - apt-get -qy dist-upgrade
48     - apt-get -qy install --no-install-recommends
49         fdroidserver git gnupg python3-setuptools
50     - sed -i -e 's,testing,sid,g' -e  's,testing,sid,g' /etc/apt/sources.list
51     - apt-get -qy update
52     - apt-get install -y --no-install-recommends aapt androguard android-platform-tools-base zipalign
53     - python3 -c 'import fdroidserver'
54     - python3 -c 'import androguard'
55     - export ANDROID_HOME=/usr/lib/android-sdk
56     - export LANG=C.UTF-8
57     - cd tests
58     - ./run-tests
59
60 # test using LTS set up with the PPA, including Recommends
61 ubuntu_lts:
62   image: ubuntu:latest
63   only:
64     - master@fdroid/fdroidserver
65   script:
66     - while ! apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 9AAC253193B65D4DF1D0A13EEC4632C79C5E0151; do sleep 15; done
67     - export RELEASE=`sed -n 's,^deb [^ ][^ ]* \([a-z]*\).*,\1,p' /etc/apt/sources.list | head -1`
68     - echo "deb http://ppa.launchpad.net/fdroid/fdroidserver/ubuntu $RELEASE main" >> /etc/apt/sources.list
69     - apt-get -qy update
70     - apt-get -qy dist-upgrade
71     - apt-get -qy install fdroidserver git python3-setuptools
72     - export ANDROID_HOME=/usr/lib/android-sdk
73     - export LANG=C.UTF-8
74     - cd tests
75     - ./run-tests
76
77 pip_install:
78   image: archlinux/base
79   only:
80     - master@fdroid/fdroidserver
81   script:
82     - pacman --sync --sysupgrade --refresh --noconfirm grep python-pip python-virtualenv tar
83     # setup venv to act as release build machine
84     - python -m venv sdist-env
85     - . sdist-env/bin/activate
86     - ./setup.py compile_catalog sdist
87     - deactivate
88     - tar tzf dist/fdroidserver-*.tar.gz | grep locale/de/LC_MESSAGES/fdroidserver.mo
89     # back to bare machine to act as user's install machine
90     - pip install dist/fdroidserver-*.tar.gz
91     - test -e /usr/share/locale/de/LC_MESSAGES/fdroidserver.mo
92     - fdroid
93     - fdroid readmeta
94     - fdroid update --help
95
96 fedora_latest:
97   image: fedora:latest
98   only:
99     - master@fdroid/fdroidserver
100   script:
101     - dnf -y update
102     - dnf -y install git gnupg java-1.8.0-openjdk-devel python3 python3-babel
103                      python3-pip rsync unzip wget
104     - ./setup.py compile_catalog sdist
105     - useradd -m -c "test account" --password "fakepassword"  testuser
106     - su testuser --login --command "cd `pwd`; pip3 install --user dist/fdroidserver-*.tar.gz"
107     - test -e ~testuser/.local/share/locale/de/LC_MESSAGES/fdroidserver.mo
108     - wget --no-verbose -O tools.zip https://dl.google.com/android/repository/tools_r25.2.4-linux.zip
109     - unzip -q tools.zip
110     - rm tools.zip
111     - export AAPT_VERSION=`sed -n "s,^MINIMUM_AAPT_VERSION\s*=\s*['\"]\(.*\)[['\"],\1,p" fdroidserver/common.py`
112     - export ANDROID_HOME=`pwd`/android-sdk
113     - mkdir $ANDROID_HOME
114     - mv tools $ANDROID_HOME/
115     - mkdir -p $ANDROID_HOME/licenses/
116     - printf "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > $ANDROID_HOME/licenses/android-sdk-license
117     - printf "\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license
118     - printf "\n79120722343a6f314e0719f863036c702b0e6b2a\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license-old
119     - mkdir ~/.android
120     - touch ~/.android/repositories.cfg
121     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools"
122     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;$AAPT_VERSION"
123     - chown -R testuser .
124     - cd tests
125     - su testuser --login --command
126         "cd `pwd`; export ANDROID_HOME=$ANDROID_HOME; fdroid=~testuser/.local/bin/fdroid ./run-tests"