CI: use Alpine for testing (MR 2074)

This commit is contained in:
Maxim Karasev 2021-06-27 16:46:29 +03:00 committed by Alexey Min
parent 1bb15765ed
commit 479b51cfb6
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
2 changed files with 7 additions and 8 deletions

View file

@ -1,7 +1,7 @@
--- ---
# Author: Clayton Craft <clayton@craftyguy.net> # Author: Clayton Craft <clayton@craftyguy.net>
image: python:3.7-slim-stretch image: alpine:latest
cache: cache:
paths: paths:
@ -12,7 +12,7 @@ before_script:
# venv created in CI_PROJECT_DIR for caching # venv created in CI_PROJECT_DIR for caching
- "[[ ! -d venv ]] && virtualenv venv -p $(which python3)" - "[[ ! -d venv ]] && virtualenv venv -p $(which python3)"
- "source venv/bin/activate" - "source venv/bin/activate"
- "pip3 install pytest-cov python-coveralls pytest" - "apk -q add py3-pytest-cov py3-coveralls py3-pytest"
- "python3 --version" - "python3 --version"
- "su pmos -c 'git config --global user.email postmarketos-ci@localhost' || true" - "su pmos -c 'git config --global user.email postmarketos-ci@localhost' || true"
- "su pmos -c 'git config --global user.name postmarketOS_CI' || true" - "su pmos -c 'git config --global user.name postmarketOS_CI' || true"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# #
# This script is meant for the gitlab CI shared runners, not for # This script is meant for the gitlab CI shared runners, not for
# any specific runners. Specific runners are expected to provide # any specific runners. Specific runners are expected to provide
@ -6,18 +6,17 @@
# Author: Clayton Craft <clayton@craftyguy.net> # Author: Clayton Craft <clayton@craftyguy.net>
# skip non-shared runner # skip non-shared runner
[[ -d "/home/pmos" ]] && echo "pmos user already exists, assume running on pre-configured runner" && exit [ -d "/home/pmos" ] && echo "pmos user already exists, assume running on pre-configured runner" && exit
# mount binfmt_misc # mount binfmt_misc
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
# install dependencies (procps: /bin/kill) # install dependencies (procps: /bin/kill)
apt update apk update
apt install -q -y git sudo procps python3-pip apk -q add git sudo bash openssl procps py3-virtualenv
pip3 install virtualenv
# create pmos user # create pmos user
echo "Creating pmos user" echo "Creating pmos user"
useradd pmos -m -s /bin/bash -b "/home" adduser -s /bin/sh -h /home/pmos pmos
chown -R pmos:pmos . chown -R pmos:pmos .
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers