From 3aeea67f373fde8a05cd8a72367a48f1d3a4288d Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 21 Jun 2022 11:02:07 +0200 Subject: Add podman local test runner --- podman/arch-testenv | 6 ++++++ podman/debian-testenv | 11 +++++++++++ podman/fedora-testenv | 7 +++++++ podman/testdata/testscript.sh | 8 ++++++++ podman/ubuntu-testenv | 6 ++++++ run-tests.sh | 14 ++++++++++++++ 6 files changed, 52 insertions(+) create mode 100644 podman/arch-testenv create mode 100644 podman/debian-testenv create mode 100644 podman/fedora-testenv create mode 100755 podman/testdata/testscript.sh create mode 100644 podman/ubuntu-testenv create mode 100755 run-tests.sh diff --git a/podman/arch-testenv b/podman/arch-testenv new file mode 100644 index 0000000..650438b --- /dev/null +++ b/podman/arch-testenv @@ -0,0 +1,6 @@ + +FROM docker.io/archlinux:latest +MAINTAINER gerbolyze@jaseg.de +RUN pacman --noconfirm -Syu +RUN pacman --noconfirm -Sy git python python-pip base-devel python-numpy python-slugify python-lxml python-click python-pillow librsvg python-scipy python-sphinx python-pytest twine python-beautifulsoup4 gerbv + diff --git a/podman/debian-testenv b/podman/debian-testenv new file mode 100644 index 0000000..544b3f2 --- /dev/null +++ b/podman/debian-testenv @@ -0,0 +1,11 @@ + +FROM docker.io/debian:latest +MAINTAINER gerbolyze@jaseg.de +RUN env DEBIAN_FRONTEND=noninteractive apt update -y +RUN env DEBIAN_FRONTEND=noninteractive apt install -y libopencv-dev libpugixml-dev libpangocairo-1.0-0 libpango1.0-dev libcairo2-dev clang make python3 git python3-wheel curl python3-pip python3-venv + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +RUN sh -c '. ~/.cargo/env && rustup install stable' +RUN sh -c '. ~/.cargo/env && rustup default stable' +RUN sh -c '. ~/.cargo/env && cargo install usvg' + diff --git a/podman/fedora-testenv b/podman/fedora-testenv new file mode 100644 index 0000000..c37de87 --- /dev/null +++ b/podman/fedora-testenv @@ -0,0 +1,7 @@ + +FROM docker.io/fedora:latest +MAINTAINER gerbolyze@jaseg.de +RUN dnf update --refresh -y +RUN dnf install -y python3 make clang opencv-devel pugixml-devel pango-devel cairo-devel rust cargo +RUN cargo install usvg + diff --git a/podman/testdata/testscript.sh b/podman/testdata/testscript.sh new file mode 100755 index 0000000..cd07d8f --- /dev/null +++ b/podman/testdata/testscript.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e +git clone /data/git git +cd git +python3 -m pip install pytest-parallel +python3 -m pytest --workers auto + diff --git a/podman/ubuntu-testenv b/podman/ubuntu-testenv new file mode 100644 index 0000000..f13aa7e --- /dev/null +++ b/podman/ubuntu-testenv @@ -0,0 +1,6 @@ + +FROM docker.io/ubuntu:latest +MAINTAINER gerbolyze@jaseg.de +RUN env DEBIAN_FRONTEND=noninteractive apt update -y +RUN env DEBIAN_FRONTEND=noninteractive apt install -y python3 git python3-wheel curl python3-pip python3-venv +RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000..50af316 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +rm -rf podman/testdata/git +git clone --depth 1 . podman/testdata/git + +for distro in arch ubuntu +do + podman build -t gerbonara-$distro-testenv -f podman/$distro-testenv + mkdir -p /tmp/gerbonara-test-out + podman run --mount type=bind,src=podman/testdata,dst=/data,ro --mount type=bind,src=/tmp/gerbonara-test-out,dst=/out gerbonara-$distro-testenv /data/testscript.sh +done + -- cgit