fdroid-repomaker/.gitlab-ci.yml

102 lines
2.0 KiB
YAML

image: debian:buster
stages:
- test
- deploy
variables:
LC_ALL: C.UTF-8
DEBIAN_FRONTEND: noninteractive
# This template needs to be in text block format since `gitlab-runner
# exec` cannot handle templates in list format.
.apt-template: &apt-template |
set -e
set -x
echo Etc/UTC > /etc/timezone
echo 'quiet "1";' \
'APT::Install-Recommends "0";' \
'APT::Install-Suggests "0";' \
'APT::Acquire::Retries "20";' \
'APT::Get::Assume-Yes "true";' \
'Dpkg::Use-Pty "0";' \
> /etc/apt/apt.conf.d/99gitlab
apt-get update
apt-get dist-upgrade
.setup-template: &setup-template
- *apt-template
- apt-get install
curl
git
libmagic1
python3-bleach
python3-cryptography
python3-libcloud
python3-libsass
python3-magic
python3-pip
python3-psycopg2
python3-qrcode
python3-rcssmin
python3-rjsmin
python3-setuptools
python3-webview
python3-wheel
rsync
aapt
pep8:
stage: test
script:
- *apt-template
- apt-get install pep8
- ./tests/test-pep8.sh
pylint:
stage: test
before_script:
- *setup-template
- pip3 install -r requirements.txt
- pip3 install -r requirements-dev.txt
script:
- ./tests/test-pylint.sh
units:
stage: test
cache:
paths:
- /usr/local/lib/python*/dist-packages
- node_modules
before_script:
- *setup-template
- apt-get install npm
- ./setup.sh
- pip3 install -r requirements-dev.txt
- npm install --user
script:
- ./tests/test-units.sh
docker:
stage: deploy
image: docker:git
services:
- docker:dind
variables:
IMAGE: registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:latest
before_script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
script:
- docker build -t $IMAGE .
- docker push $IMAGE
when: on_success
only:
- master
environment:
name: docker