2016-02-29 20:56:02 +01:00
|
|
|
|
2020-01-14 20:04:14 +01:00
|
|
|
variables:
|
|
|
|
pip: pip3 --timeout 100 --retries 10
|
2020-08-06 15:44:37 +02:00
|
|
|
# speed up git checkout phase
|
|
|
|
GIT_DEPTH: 1
|
2020-01-14 20:04:14 +01:00
|
|
|
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
# Run the whole test suite in an environment that is like the buildserver guest VM.
|
2021-03-22 23:06:16 +01:00
|
|
|
ci-images-base run-tests:
|
2020-12-04 11:25:02 +01:00
|
|
|
image: registry.gitlab.com/fdroid/ci-images-base
|
2015-08-28 00:59:46 +02:00
|
|
|
script:
|
2021-04-06 10:22:29 +02:00
|
|
|
- $pip install -e .
|
2021-03-22 23:06:16 +01:00
|
|
|
- ./tests/run-tests
|
|
|
|
# make sure that translations do not cause stacktraces
|
|
|
|
- cd $CI_PROJECT_DIR/locale
|
|
|
|
- for locale in *; do
|
|
|
|
test -d $locale || continue;
|
|
|
|
for cmd in `sed -n 's/.*("\(.*\)", *_.*/\1/p' $CI_PROJECT_DIR/fdroid`; do
|
|
|
|
LANGUAGE=$locale $CI_PROJECT_DIR/fdroid $cmd --help > /dev/null;
|
|
|
|
done
|
|
|
|
done
|
2017-05-27 21:13:36 +02:00
|
|
|
|
2020-06-09 22:19:06 +02:00
|
|
|
# Test that the parsing of the .yml metadata format didn't change from last
|
2018-01-18 10:02:29 +01:00
|
|
|
# released version. This uses the commit ID of the release tags,
|
|
|
|
# rather than the release tag itself so that contributor forks do not
|
|
|
|
# need to include the tags in them for this test to work.
|
|
|
|
#
|
|
|
|
# The COMMIT_ID should be bumped after each release, so that the list
|
|
|
|
# of sed hacks needed does not continuously grow.
|
2017-05-27 21:13:36 +02:00
|
|
|
metadata_v0:
|
2020-12-04 11:25:02 +01:00
|
|
|
image: registry.gitlab.com/fdroid/ci-images-base
|
2018-01-18 10:02:29 +01:00
|
|
|
variables:
|
2020-08-06 15:44:37 +02:00
|
|
|
GIT_DEPTH: 1000
|
2020-12-15 08:49:28 +01:00
|
|
|
RELEASE_COMMIT_ID: 37c95f59a17d86723fdb71e984121726db777f32 # 2.0a5~
|
2017-05-27 21:13:36 +02:00
|
|
|
script:
|
2020-06-09 22:19:06 +02:00
|
|
|
- git fetch https://gitlab.com/fdroid/fdroidserver.git $RELEASE_COMMIT_ID
|
2017-05-27 21:13:36 +02:00
|
|
|
- cd tests
|
2017-06-28 23:12:04 +02:00
|
|
|
- export GITCOMMIT=`git describe`
|
2018-01-18 10:02:29 +01:00
|
|
|
- git checkout $RELEASE_COMMIT_ID
|
2017-05-27 21:13:36 +02:00
|
|
|
- cd ..
|
2020-06-09 22:19:06 +02:00
|
|
|
- git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git
|
2017-05-27 21:13:36 +02:00
|
|
|
- cd fdroiddata
|
2017-08-31 20:36:07 +02:00
|
|
|
- ../tests/dump_internal_metadata_format.py
|
2017-05-27 21:13:36 +02:00
|
|
|
- cd ..
|
|
|
|
- git reset --hard
|
2017-06-28 23:12:04 +02:00
|
|
|
- git checkout $GITCOMMIT
|
2017-05-27 21:13:36 +02:00
|
|
|
- cd fdroiddata
|
2017-08-31 20:36:07 +02:00
|
|
|
- ../tests/dump_internal_metadata_format.py
|
2018-01-30 11:20:30 +01:00
|
|
|
- sed -i
|
2020-06-16 14:39:46 +02:00
|
|
|
-e '/Liberapay:/d'
|
2020-03-10 15:56:03 +01:00
|
|
|
-e '/OpenCollective/d'
|
2018-01-23 23:16:05 +01:00
|
|
|
metadata/dump_*/*.yaml
|
2017-05-27 21:13:36 +02:00
|
|
|
- diff -uw metadata/dump_*
|
2017-12-04 22:43:41 +01:00
|
|
|
|
2019-09-23 11:50:51 +02:00
|
|
|
.apt-template: &apt-template
|
|
|
|
variables:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
|
|
|
- echo Etc/UTC > /etc/timezone
|
|
|
|
- echo 'APT::Install-Recommends "0";'
|
|
|
|
'APT::Install-Suggests "0";'
|
|
|
|
'APT::Acquire::Retries "20";'
|
|
|
|
'APT::Get::Assume-Yes "true";'
|
|
|
|
'Dpkg::Use-Pty "0";'
|
|
|
|
'quiet "1";'
|
|
|
|
>> /etc/apt/apt.conf.d/99gitlab
|
|
|
|
- apt-get update
|
|
|
|
- apt-get dist-upgrade
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
|
|
|
# Since F-Droid uses Debian as its default platform, from production
|
|
|
|
# servers to CI to contributor machines, it is important to know when
|
|
|
|
# changes in Debian break our stuff. This tests against the latest
|
|
|
|
# dependencies as they are included in Debian.
|
2017-12-04 22:43:41 +01:00
|
|
|
debian_testing:
|
|
|
|
image: debian:testing
|
2019-09-23 11:50:51 +02:00
|
|
|
<<: *apt-template
|
2017-12-04 22:43:41 +01:00
|
|
|
only:
|
|
|
|
- master@fdroid/fdroidserver
|
|
|
|
script:
|
2019-09-23 11:50:51 +02:00
|
|
|
- apt-get install
|
2019-09-23 11:08:25 +02:00
|
|
|
aapt
|
|
|
|
androguard
|
2020-09-10 17:12:16 +02:00
|
|
|
apksigner
|
2019-09-23 11:08:25 +02:00
|
|
|
fdroidserver
|
|
|
|
git
|
|
|
|
gnupg
|
|
|
|
python3-defusedxml
|
|
|
|
python3-setuptools
|
|
|
|
zipalign
|
2018-02-16 14:25:47 +01:00
|
|
|
- python3 -c 'import fdroidserver'
|
|
|
|
- python3 -c 'import androguard'
|
2017-12-04 22:43:41 +01:00
|
|
|
- cd tests
|
|
|
|
- ./run-tests
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2020-11-30 11:22:45 +01:00
|
|
|
# Test using latest LTS set up with the PPA, including Recommends.
|
2019-07-01 11:34:59 +02:00
|
|
|
ubuntu_lts_ppa:
|
2017-12-04 22:43:41 +01:00
|
|
|
image: ubuntu:latest
|
2019-09-23 11:50:51 +02:00
|
|
|
<<: *apt-template
|
2017-12-04 22:43:41 +01:00
|
|
|
only:
|
|
|
|
- master@fdroid/fdroidserver
|
|
|
|
script:
|
2019-09-23 11:50:51 +02:00
|
|
|
- export ANDROID_HOME=/usr/lib/android-sdk
|
|
|
|
- apt-get install gnupg
|
2018-02-22 10:27:10 +01:00
|
|
|
- while ! apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 9AAC253193B65D4DF1D0A13EEC4632C79C5E0151; do sleep 15; done
|
2017-12-04 22:43:41 +01:00
|
|
|
- export RELEASE=`sed -n 's,^deb [^ ][^ ]* \([a-z]*\).*,\1,p' /etc/apt/sources.list | head -1`
|
|
|
|
- echo "deb http://ppa.launchpad.net/fdroid/fdroidserver/ubuntu $RELEASE main" >> /etc/apt/sources.list
|
2019-09-23 11:50:51 +02:00
|
|
|
- apt-get update
|
|
|
|
- apt-get dist-upgrade
|
2021-03-24 11:20:00 +01:00
|
|
|
- apt-get install --install-recommends fdroidserver git python3-setuptools
|
2017-12-04 22:43:41 +01:00
|
|
|
- cd tests
|
|
|
|
- ./run-tests
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2021-01-22 22:12:17 +01:00
|
|
|
# Test using Ubuntu/bionic LTS (supported til 2022) with all depends
|
|
|
|
# from pypi. The venv is used to isolate the dist tarball generation
|
|
|
|
# environment from the clean install environment.
|
|
|
|
ubuntu_bionic_pip:
|
|
|
|
image: ubuntu:bionic
|
2019-09-23 11:50:51 +02:00
|
|
|
<<: *apt-template
|
2018-05-14 11:22:00 +02:00
|
|
|
script:
|
2020-04-15 20:27:13 +02:00
|
|
|
- apt-get install git default-jdk-headless python3-pip python3-venv rsync zipalign libarchive13
|
2018-05-14 11:22:00 +02:00
|
|
|
- rm -rf env
|
2019-07-01 11:22:32 +02:00
|
|
|
- pyvenv env
|
2018-05-14 11:22:00 +02:00
|
|
|
- . env/bin/activate
|
2020-01-14 20:04:14 +01:00
|
|
|
- $pip install --upgrade babel pip setuptools
|
2017-12-06 10:13:45 +01:00
|
|
|
# setup venv to act as release build machine
|
|
|
|
- python -m venv sdist-env
|
|
|
|
- . sdist-env/bin/activate
|
|
|
|
- ./setup.py compile_catalog sdist
|
|
|
|
- deactivate
|
|
|
|
- tar tzf dist/fdroidserver-*.tar.gz | grep locale/de/LC_MESSAGES/fdroidserver.mo
|
|
|
|
# back to bare machine to act as user's install machine
|
2021-01-22 22:12:17 +01:00
|
|
|
- $pip install --upgrade pip setuptools wheel # make this go away: "error: invalid command 'bdist_wheel'"
|
2020-11-28 11:47:26 +01:00
|
|
|
- $pip install dist/fdroidserver-*.tar.gz
|
2021-01-15 19:57:32 +01:00
|
|
|
- tar xzf dist/fdroidserver-*.tar.gz
|
|
|
|
- cd fdroidserver-*
|
2021-01-23 13:36:41 +01:00
|
|
|
- fdroid=`which fdroid` ./tests/run-tests
|
2020-11-28 11:47:26 +01:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2020-12-03 16:04:02 +01:00
|
|
|
# test install process on a bleeding edge distro with pip
|
|
|
|
arch_pip_install:
|
2020-11-28 11:47:26 +01:00
|
|
|
image: archlinux/base
|
2020-12-03 16:04:02 +01:00
|
|
|
only:
|
|
|
|
- master@fdroid/fdroidserver
|
2020-11-28 11:47:26 +01:00
|
|
|
script:
|
2021-02-09 09:14:08 +01:00
|
|
|
- pacman --sync --sysupgrade --refresh --noconfirm gcc git grep python-pip python-virtualenv python-wheel tar
|
2021-02-08 06:37:44 +01:00
|
|
|
- pip install -e .[test]
|
2017-12-06 10:13:45 +01:00
|
|
|
- fdroid
|
|
|
|
- fdroid readmeta
|
|
|
|
- fdroid update --help
|
|
|
|
|
2021-03-05 00:02:21 +01:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
# The gradlew-fdroid tests are isolated from the rest of the test
|
|
|
|
# suite, so they run as their own job.
|
2021-03-05 00:02:21 +01:00
|
|
|
gradlew-fdroid:
|
|
|
|
image: debian:bullseye
|
|
|
|
<<: *apt-template
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- .gitlab-ci.yml
|
|
|
|
- gradlew-fdroid
|
|
|
|
- tests/test-gradlew-fdroid
|
|
|
|
script:
|
|
|
|
- apt-get install ca-certificates curl default-jdk-headless unzip
|
|
|
|
- ./tests/test-gradlew-fdroid
|
|
|
|
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
# Run all the various linters and static analysis tools.
|
2018-08-29 17:48:06 +02:00
|
|
|
lint_format_safety_bandit_checks:
|
2021-05-10 16:02:41 +02:00
|
|
|
image: alpine:3.13
|
2018-05-17 13:39:14 +02:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
2018-05-11 16:57:22 +02:00
|
|
|
script:
|
2020-05-08 12:29:54 +02:00
|
|
|
- apk add --no-cache bash build-base dash ca-certificates gcc python3 python3-dev
|
2018-05-17 13:39:14 +02:00
|
|
|
- python3 -m ensurepip
|
2021-05-10 16:02:41 +02:00
|
|
|
- $pip install Babel bandit pycodestyle pyflakes pylint safety
|
2018-05-25 12:12:40 +02:00
|
|
|
- export EXITVALUE=0
|
2020-05-08 11:42:59 +02:00
|
|
|
- function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; }
|
|
|
|
- ./hooks/pre-commit || set_error
|
2018-08-29 17:48:06 +02:00
|
|
|
- bandit
|
|
|
|
-ii
|
2021-05-10 16:02:41 +02:00
|
|
|
-s B110,B404,B408,B410,B603,B607
|
2018-09-04 18:47:29 +02:00
|
|
|
-r $CI_PROJECT_DIR fdroid
|
2020-05-08 11:42:59 +02:00
|
|
|
|| set_error
|
|
|
|
- safety check --full-report || set_error
|
2018-05-14 12:02:30 +02:00
|
|
|
- pylint --rcfile=.pylint-rcfile --output-format=colorized --reports=n
|
|
|
|
fdroid
|
|
|
|
makebuildserver
|
|
|
|
setup.py
|
|
|
|
fdroidserver/*.py
|
|
|
|
tests/*.py
|
|
|
|
tests/*.TestCase
|
2020-05-08 11:42:59 +02:00
|
|
|
|| set_error
|
2019-01-28 13:26:37 +01:00
|
|
|
- apk add --no-cache gettext make
|
2020-05-08 11:42:59 +02:00
|
|
|
- make -C locale compile || set_error
|
2019-01-29 11:32:39 +01:00
|
|
|
- rm -f locale/*/*/*.mo
|
|
|
|
- pybabel compile --domain=fdroidserver --directory locale 2>&1 | (grep -F "error:" && exit 1) || true
|
2018-05-25 12:12:40 +02:00
|
|
|
- exit $EXITVALUE
|
2018-05-14 12:02:30 +02:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2021-03-12 08:49:40 +01:00
|
|
|
lint_mypy:
|
|
|
|
image: python:3.9-buster
|
|
|
|
script:
|
|
|
|
- pip install mypy
|
|
|
|
- pip install -e .[test]
|
2021-04-14 22:54:48 +02:00
|
|
|
# exclude vendored file
|
|
|
|
- mypy --exclude fdroidserver/apksigcopier.py
|
2021-03-12 08:49:40 +01:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2017-12-04 22:43:41 +01:00
|
|
|
fedora_latest:
|
|
|
|
image: fedora:latest
|
|
|
|
only:
|
|
|
|
- master@fdroid/fdroidserver
|
|
|
|
script:
|
2019-01-29 13:40:55 +01:00
|
|
|
# tricks to hopefully make runs more reliable
|
|
|
|
- echo "timeout=600" >> /etc/dnf/dnf.conf
|
|
|
|
- echo "retries=50" >> /etc/dnf/dnf.conf
|
|
|
|
- echo "keepcache=True" >> /etc/dnf/dnf.conf
|
|
|
|
|
|
|
|
- dnf -y update || dnf -y update
|
2019-03-18 16:01:34 +01:00
|
|
|
- dnf -y install @development-tools
|
2019-11-05 15:30:34 +01:00
|
|
|
diffutils
|
2019-03-18 16:01:34 +01:00
|
|
|
findutils
|
2018-12-06 11:50:08 +01:00
|
|
|
git
|
|
|
|
gnupg
|
|
|
|
java-1.8.0-openjdk-devel
|
|
|
|
python3
|
|
|
|
python3-babel
|
2020-11-02 15:20:23 +01:00
|
|
|
python3-matplotlib
|
2018-12-06 11:50:08 +01:00
|
|
|
python3-pip
|
|
|
|
rsync
|
|
|
|
unzip
|
|
|
|
wget
|
|
|
|
which
|
2017-12-06 17:51:12 +01:00
|
|
|
- ./setup.py compile_catalog sdist
|
|
|
|
- useradd -m -c "test account" --password "fakepassword" testuser
|
2020-01-14 20:04:14 +01:00
|
|
|
- su testuser --login --command "cd `pwd`; $pip install --user dist/fdroidserver-*.tar.gz"
|
2017-12-06 17:51:12 +01:00
|
|
|
- test -e ~testuser/.local/share/locale/de/LC_MESSAGES/fdroidserver.mo
|
2019-03-30 22:10:21 +01:00
|
|
|
- wget --no-verbose -O tools.zip https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
|
2017-12-04 22:43:41 +01:00
|
|
|
- unzip -q tools.zip
|
|
|
|
- rm tools.zip
|
2020-09-10 17:14:15 +02:00
|
|
|
- export BUILD_TOOLS_VERSION=`sed -n "s,^MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION\s*=\s*['\"]\(.*\)[['\"],\1,p" fdroidserver/common.py`
|
2018-12-06 11:50:08 +01:00
|
|
|
- export JAVA_HOME=/etc/alternatives/jre
|
2017-12-06 17:51:12 +01:00
|
|
|
- export ANDROID_HOME=`pwd`/android-sdk
|
2017-12-04 22:43:41 +01:00
|
|
|
- mkdir $ANDROID_HOME
|
|
|
|
- mv tools $ANDROID_HOME/
|
|
|
|
- mkdir -p $ANDROID_HOME/licenses/
|
2019-03-30 22:10:21 +01:00
|
|
|
- printf "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > $ANDROID_HOME/licenses/android-sdk-license
|
2017-12-04 22:43:41 +01:00
|
|
|
- printf "\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license
|
|
|
|
- printf "\n79120722343a6f314e0719f863036c702b0e6b2a\n84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license-old
|
|
|
|
- mkdir ~/.android
|
|
|
|
- touch ~/.android/repositories.cfg
|
2021-01-27 23:50:53 +01:00
|
|
|
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" > /dev/null
|
|
|
|
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;$BUILD_TOOLS_VERSION" > /dev/null
|
2017-12-06 17:51:12 +01:00
|
|
|
- chown -R testuser .
|
2017-12-04 22:43:41 +01:00
|
|
|
- cd tests
|
2017-12-06 17:51:12 +01:00
|
|
|
- su testuser --login --command
|
|
|
|
"cd `pwd`; export ANDROID_HOME=$ANDROID_HOME; fdroid=~testuser/.local/bin/fdroid ./run-tests"
|
2019-09-09 12:09:01 +02:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
2019-09-09 12:09:01 +02:00
|
|
|
gradle:
|
2021-01-24 17:09:32 +01:00
|
|
|
image: debian:bullseye
|
|
|
|
<<: *apt-template
|
2021-01-25 11:04:49 +01:00
|
|
|
variables:
|
|
|
|
GIT_DEPTH: 1000
|
2019-09-09 12:09:01 +02:00
|
|
|
script:
|
2021-01-24 17:09:32 +01:00
|
|
|
- apt-get install
|
|
|
|
ca-certificates
|
|
|
|
git
|
|
|
|
openssh-client
|
|
|
|
python3-bs4
|
|
|
|
python3-colorama
|
|
|
|
python3-git
|
|
|
|
python3-gitlab
|
|
|
|
python3-requests
|
2021-01-24 11:57:46 +01:00
|
|
|
# if this is a merge request fork, then only check if makebuildserver or gradlew-fdroid changed
|
2019-09-09 12:09:01 +02:00
|
|
|
- if [ "$CI_PROJECT_NAMESPACE" != "fdroid" ]; then
|
|
|
|
git fetch https://gitlab.com/fdroid/fdroidserver.git;
|
|
|
|
for f in `git diff --name-only --diff-filter=d FETCH_HEAD...HEAD`; do
|
|
|
|
test "$f" == "makebuildserver" && export CHANGED="yes";
|
2021-01-24 11:57:46 +01:00
|
|
|
test "$f" == "gradlew-fdroid" && export CHANGED="yes";
|
2019-09-09 12:09:01 +02:00
|
|
|
done;
|
|
|
|
test -z "$CHANGED" && exit;
|
|
|
|
fi
|
|
|
|
- ./tests/gradle-release-checksums.py
|
2020-11-09 14:46:25 +01:00
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
|
|
|
|
# Run an actual build in a simple, faked version of the buildserver guest VM.
|
2020-12-10 10:54:47 +01:00
|
|
|
fdroid build:
|
2020-12-04 11:23:22 +01:00
|
|
|
image: registry.gitlab.com/fdroid/ci-images-client
|
|
|
|
only:
|
|
|
|
changes:
|
2020-12-10 10:54:47 +01:00
|
|
|
- .gitlab-ci.yml
|
2020-12-04 11:23:22 +01:00
|
|
|
- buildserver/provision-apt-get-install
|
2020-12-10 10:54:47 +01:00
|
|
|
- fdroidserver/build.py
|
|
|
|
- fdroidserver/common.py
|
|
|
|
- fdroidserver/exception.py
|
|
|
|
- fdroidserver/metadata.py
|
|
|
|
- fdroidserver/net.py
|
|
|
|
- fdroidserver/scanner.py
|
|
|
|
- fdroidserver/vmtools.py
|
|
|
|
cache:
|
|
|
|
key: "$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- .gradle
|
2020-11-09 14:46:25 +01:00
|
|
|
script:
|
|
|
|
- bash buildserver/provision-apt-get-install http://deb.debian.org/debian
|
|
|
|
- apt-get dist-upgrade
|
|
|
|
- apt-get install -t stretch-backports
|
|
|
|
python3-asn1crypto
|
2020-12-10 10:54:47 +01:00
|
|
|
python3-pip
|
2020-11-09 14:46:25 +01:00
|
|
|
python3-ruamel.yaml
|
2020-12-10 10:54:47 +01:00
|
|
|
python3-setuptools
|
|
|
|
python3-venv
|
2020-11-09 14:46:25 +01:00
|
|
|
- apt-get purge fdroidserver
|
2020-12-10 10:54:47 +01:00
|
|
|
- pyvenv env --system-site-packages
|
|
|
|
- . env/bin/activate
|
|
|
|
- $pip install -e .
|
|
|
|
- export PATH="$CI_PROJECT_DIR:$PATH"
|
|
|
|
- export PYTHONPATH=$CI_PROJECT_DIR
|
|
|
|
- export PYTHONUNBUFFERED=true
|
|
|
|
|
|
|
|
- git clone https://gitlab.com/fdroid/fdroiddata.git --depth 1
|
|
|
|
- cd fdroiddata
|
|
|
|
- test -d build || mkdir build
|
|
|
|
|
|
|
|
- export GRADLE_USER_HOME=$CI_PROJECT_DIR/.gradle
|
|
|
|
# try a user build first
|
|
|
|
- fdroid build --verbose --latest org.fdroid.fdroid.privileged
|
|
|
|
# each `fdroid build --on-server` run expects sudo, then uninstalls it
|
|
|
|
- apt-get install sudo
|
|
|
|
- fdroid build --verbose --on-server --no-tarball --latest org.fdroid.fdroid
|
2020-12-08 19:44:39 +01:00
|
|
|
|
|
|
|
|
2021-04-06 11:52:44 +02:00
|
|
|
# test the plugin API and specifically the fetchsrclibs plugin, which
|
|
|
|
# is used by the `fdroid build` job. This uses a fixed commit from
|
|
|
|
# fdroiddata because that one is known to work, and this is a CI job,
|
|
|
|
# so it should be isolated from the normal churn of fdroiddata.
|
2021-01-11 12:05:02 +01:00
|
|
|
plugin_fetchsrclibs:
|
|
|
|
image: debian:buster
|
|
|
|
<<: *apt-template
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- .gitlab-ci.yml
|
|
|
|
- examples/fdroid_fetchsrclibs.py
|
|
|
|
- fdroidserver/__main__.py
|
|
|
|
script:
|
|
|
|
- apt-get install
|
|
|
|
curl
|
|
|
|
git
|
2021-02-08 09:11:48 +01:00
|
|
|
python3-cryptography
|
2021-01-11 12:05:02 +01:00
|
|
|
python3-pip
|
|
|
|
python3-venv
|
2021-02-08 09:11:48 +01:00
|
|
|
- python3 -m venv --system-site-packages env
|
2021-01-11 12:05:02 +01:00
|
|
|
- . env/bin/activate
|
|
|
|
- export PATH="$CI_PROJECT_DIR:$PATH"
|
|
|
|
- export PYTHONPATH="$CI_PROJECT_DIR/examples"
|
|
|
|
- $pip install wheel # to make this go away: "error: invalid command 'bdist_wheel'"
|
|
|
|
- $pip install -e .
|
|
|
|
- fdroid | grep fetchsrclibs
|
|
|
|
|
|
|
|
- mkdir fdroiddata
|
2021-04-06 10:40:12 +02:00
|
|
|
- commitid=b9e9a077d720c86ff6fff4dbb341254cc4370b1a
|
|
|
|
- curl https://gitlab.com/fdroid/fdroiddata/-/archive/${commitid}/fdroiddata-${commitid}.tar.gz
|
2021-01-11 12:05:02 +01:00
|
|
|
| tar -xz --directory=fdroiddata --strip-components=1
|
|
|
|
- cd fdroiddata
|
|
|
|
- fdroid fetchsrclibs freemap.opentrail:9 --verbose
|
|
|
|
- test -d build/freemap.opentrail/.git
|
|
|
|
- test -d build/srclib/andromaps/.git
|
|
|
|
- test -d build/srclib/freemaplib/.git
|
|
|
|
- test -d build/srclib/freemaplibProj/.git
|
|
|
|
- test -d build/srclib/JCoord/.git
|
|
|
|
- test -d build/srclib/javaproj/.git
|
|
|
|
|
|
|
|
|
2020-12-08 19:44:39 +01:00
|
|
|
# test a full update and deploy cycle to gitlab.com
|
|
|
|
servergitmirrors:
|
2021-02-08 11:40:41 +01:00
|
|
|
image: debian:buster
|
2020-12-08 19:44:39 +01:00
|
|
|
<<: *apt-template
|
|
|
|
only:
|
|
|
|
- master@fdroid/fdroidserver
|
|
|
|
script:
|
|
|
|
- apt-get install
|
|
|
|
default-jdk-headless
|
|
|
|
git
|
|
|
|
openssh-client
|
|
|
|
openssl
|
2021-02-08 11:40:41 +01:00
|
|
|
python3-cryptography
|
2020-12-08 19:44:39 +01:00
|
|
|
python3-pip
|
|
|
|
python3-venv
|
|
|
|
rsync
|
|
|
|
wget
|
2021-02-08 11:40:41 +01:00
|
|
|
- python3 -m venv --system-site-packages env
|
2020-12-08 19:44:39 +01:00
|
|
|
- . env/bin/activate
|
|
|
|
- export PYTHONPATH=`pwd`
|
|
|
|
- $pip install -e .
|
|
|
|
- mkdir /root/.ssh/
|
|
|
|
- ./tests/key-tricks.py
|
|
|
|
- ssh-keyscan gitlab.com >> /root/.ssh/known_hosts
|
|
|
|
- test -d /tmp/fdroid/repo || mkdir -p /tmp/fdroid/repo
|
|
|
|
- cp tests/config.py tests/keystore.jks /tmp/fdroid/
|
|
|
|
- cp tests/repo/com.politedroid_6.apk /tmp/fdroid/repo/
|
|
|
|
- cd /tmp/fdroid
|
|
|
|
- touch fdroid-icon.png
|
|
|
|
- printf "\nservergitmirrors = 'git@gitlab.com:fdroid/ci-test-servergitmirrors-repo.git'\n" >> config.py
|
|
|
|
- $PYTHONPATH/fdroid update --verbose --create-metadata
|
|
|
|
- $PYTHONPATH/fdroid deploy --verbose
|
|
|
|
- export DLURL=`grep -Eo 'https://gitlab.com/fdroid/ci-test-servergitmirrors-repo[^"]+' repo/index-v1.json`
|
|
|
|
- echo $DLURL
|
|
|
|
- wget $DLURL/index-v1.jar
|
|
|
|
- diff repo/index-v1.jar index-v1.jar
|
2021-05-03 15:35:11 +02:00
|
|
|
|
|
|
|
Build documentation:
|
|
|
|
image: python:3.9-buster
|
|
|
|
script:
|
|
|
|
- pip install -e .[docs]
|
|
|
|
- cd docs
|
|
|
|
- sphinx-apidoc -o ./source ../fdroidserver -M -e
|
|
|
|
- sphinx-autogen -o generated source/*.rst
|
|
|
|
- make html
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-05-10 07:50:45 +02:00
|
|
|
- docs/build/html/
|
|
|
|
|
|
|
|
pages:
|
|
|
|
image: alpine:latest
|
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- cp docs/build/html public -r # GL Pages needs the files in a directory named "public"
|
2021-05-10 07:53:21 +02:00
|
|
|
artifacts:
|
2021-05-10 07:50:45 +02:00
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
needs: ["Build documentation"]
|
2021-05-10 08:06:08 +02:00
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # only publish pages on default (master) branch
|