chiark / gitweb /
381df6708e2c3cc731ed4a61dc371163124a077d
[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. Ensure that the official tags are included when
11 # running these tests on forks as well.
12 metadata_v0:
13   image: registry.gitlab.com/fdroid/ci-images-server:latest
14   script:
15     - git fetch https://gitlab.com/fdroid/fdroidserver 0.8
16     - cd tests
17     - export GITCOMMIT=`git describe`
18     - git checkout 0.8  # bump after release
19     - cd ..
20     - git clone --depth 1 https://gitlab.com/fdroid/fdroiddata
21     - cd fdroiddata
22     - ../tests/dump_internal_metadata_format.py
23     - cd ..
24     - git reset --hard
25     - git checkout $GITCOMMIT
26     - cd fdroiddata
27     - ../tests/dump_internal_metadata_format.py
28     - sed -i -e '/LiberapayID/d'
29           metadata/dump_*/*.yaml
30     - diff -uw metadata/dump_*
31
32 debian_testing:
33   image: debian:testing
34   only:
35     - master@fdroid/fdroidserver
36   script:
37     - apt update -y
38     - apt dist-upgrade -y
39     - apt-get install -y --no-install-recommends
40         aapt adb android-platform-tools-base android-sdk-common fdroidserver
41         git gnupg python3-setuptools zipalign
42     - export ANDROID_HOME=/usr/lib/android-sdk
43     - export LANG=C.UTF-8
44     - cd tests
45     - rm -f install.TestCase  # fails frequently and is unimportant
46     - echo "Debian's build-tools is too old, remove once the package has been updated"
47     - sed -i '/android.permission.READ_EXTERNAL_STORAGE/d' tests/repo/index.xml
48     - sed -i '/^diff -uw .*index-v1.json$/d' tests/run-tests
49     - ./run-tests
50
51 ubuntu_lts:
52   image: ubuntu:latest
53   only:
54     - master@fdroid/fdroidserver
55   script:
56     - apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 9AAC253193B65D4DF1D0A13EEC4632C79C5E0151
57     - export RELEASE=`sed -n 's,^deb [^ ][^ ]* \([a-z]*\).*,\1,p' /etc/apt/sources.list | head -1`
58     - echo "deb http://ppa.launchpad.net/fdroid/fdroidserver/ubuntu $RELEASE main" >> /etc/apt/sources.list
59     - apt update -y
60     - apt dist-upgrade -y
61     - apt-get install -y --no-install-recommends
62         aapt adb android-platform-tools-base android-sdk-common fdroidserver
63         git gnupg python3-setuptools unzip wget zipalign
64     - export ANDROID_HOME=/usr/lib/android-sdk
65     # xenial's aapt is too old
66     - wget --no-verbose https://dl.google.com/android/repository/build-tools_r27.0.1-linux.zip
67     - unzip -q build-tools_r27.0.1-linux.zip
68     - rm build-tools_r27.0.1-linux.zip
69     - mv android-8.1.0 $ANDROID_HOME/build-tools/27.0.1
70     - export LANG=C.UTF-8
71     - cd tests
72     - ./run-tests
73
74 pip_install:
75   image: archlinux/base
76   only:
77     - master@fdroid/fdroidserver
78   script:
79     - pacman --sync --sysupgrade --refresh --noconfirm grep python-pip python-virtualenv tar
80     # setup venv to act as release build machine
81     - python -m venv sdist-env
82     - . sdist-env/bin/activate
83     - ./setup.py compile_catalog sdist
84     - deactivate
85     - tar tzf dist/fdroidserver-*.tar.gz | grep locale/de/LC_MESSAGES/fdroidserver.mo
86     # back to bare machine to act as user's install machine
87     - pip install dist/fdroidserver-*.tar.gz
88     - test -e /usr/share/locale/de/LC_MESSAGES/fdroidserver.mo
89     - fdroid
90     - fdroid readmeta
91     - fdroid update --help
92
93 fedora_latest:
94   image: fedora:latest
95   only:
96     - master@fdroid/fdroidserver
97   script:
98     - dnf -y update
99     - dnf -y install git gnupg java-1.8.0-openjdk-devel python3 python3-babel
100                      python3-pip rsync unzip wget
101     - ./setup.py compile_catalog sdist
102     - useradd -m -c "test account" --password "fakepassword"  testuser
103     - su testuser --login --command "cd `pwd`; pip3 install --user dist/fdroidserver-*.tar.gz"
104     - test -e ~testuser/.local/share/locale/de/LC_MESSAGES/fdroidserver.mo
105     - wget --no-verbose -O tools.zip https://dl.google.com/android/repository/tools_r25.2.4-linux.zip
106     - unzip -q tools.zip
107     - rm tools.zip
108     - export ANDROID_HOME=`pwd`/android-sdk
109     - mkdir $ANDROID_HOME
110     - mv tools $ANDROID_HOME/
111     - mkdir -p $ANDROID_HOME/licenses/
112     - printf "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > $ANDROID_HOME/licenses/android-sdk-license
113     - printf "\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license
114     - printf "\n79120722343a6f314e0719f863036c702b0e6b2a\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license-old
115     - mkdir ~/.android
116     - touch ~/.android/repositories.cfg
117     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools"
118     - echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;26.0.2"
119     - chown -R testuser .
120     - cd tests
121     - su testuser --login --command
122         "cd `pwd`; export ANDROID_HOME=$ANDROID_HOME; fdroid=~testuser/.local/bin/fdroid ./run-tests"