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