CI: use Alpine for testing (MR 2074)
This commit is contained in:
parent
1bb15765ed
commit
479b51cfb6
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
# Author: Clayton Craft <clayton@craftyguy.net>
|
||||
|
||||
image: python:3.7-slim-stretch
|
||||
image: alpine:latest
|
||||
|
||||
cache:
|
||||
paths:
|
||||
|
@ -12,7 +12,7 @@ before_script:
|
|||
# venv created in CI_PROJECT_DIR for caching
|
||||
- "[[ ! -d venv ]] && virtualenv venv -p $(which python3)"
|
||||
- "source venv/bin/activate"
|
||||
- "pip3 install pytest-cov python-coveralls pytest"
|
||||
- "apk -q add py3-pytest-cov py3-coveralls py3-pytest"
|
||||
- "python3 --version"
|
||||
- "su pmos -c 'git config --global user.email postmarketos-ci@localhost' || true"
|
||||
- "su pmos -c 'git config --global user.name postmarketOS_CI' || true"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script is meant for the gitlab CI shared runners, not for
|
||||
# any specific runners. Specific runners are expected to provide
|
||||
|
@ -6,18 +6,17 @@
|
|||
# Author: Clayton Craft <clayton@craftyguy.net>
|
||||
|
||||
# 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 -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
|
||||
# install dependencies (procps: /bin/kill)
|
||||
apt update
|
||||
apt install -q -y git sudo procps python3-pip
|
||||
pip3 install virtualenv
|
||||
apk update
|
||||
apk -q add git sudo bash openssl procps py3-virtualenv
|
||||
|
||||
# create 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 .
|
||||
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
|
Loading…
Reference in New Issue