From 2a7fdcd810fbb5910efbe5cb231ea1701c318076 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 19 May 2021 14:12:33 +0200 Subject: [PATCH] feat: make sure our debian repo is WAI (#351) We want to be sure it's working for all the supported archs. See https://github.com/ooni/probe/issues/1484 --- .github/workflows/debianrepo.yml | 36 ++++++++++++++++++++++++++ E2E/debian.sh | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/debianrepo.yml create mode 100755 E2E/debian.sh diff --git a/.github/workflows/debianrepo.yml b/.github/workflows/debianrepo.yml new file mode 100644 index 0000000..e7b21ac --- /dev/null +++ b/.github/workflows/debianrepo.yml @@ -0,0 +1,36 @@ +# debianrepo ensures we can install on debian with the official build instructions +name: linux +on: + push: + branches: + - "master" + - "issue/1484" + +jobs: + test_386: + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v2 + - run: ./E2E/debian.sh docker i386 + + test_amd64: + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v2 + - run: ./E2E/debian.sh docker amd64 + + test_arm: + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get update -q + - run: sudo apt-get install -y qemu-user-static + - run: ./E2E/debian.sh docker armhf + + build_arm64: + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get update -q + - run: sudo apt-get install -y qemu-user-static + - run: ./E2E/debian.sh docker arm64 diff --git a/E2E/debian.sh b/E2E/debian.sh new file mode 100755 index 0000000..e13dee2 --- /dev/null +++ b/E2E/debian.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# This script checks whether we can install ooniprobe on debian +# for a specific architecture using docker and the official +# install instructions published at https://ooni.org/install. + +set -e + +install_flow() { + set -x + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install --yes gnupg + apt-key adv --verbose --keyserver hkp://keyserver.ubuntu.com --recv-keys 'B5A08F01796E7F521861B449372D1FF271F2DD50' + echo "deb http://deb.ooni.org/ unstable main" | tee /etc/apt/sources.list.d/ooniprobe.list + apt-get update + apt-get install --yes ooniprobe-cli +} + +docker_flow() { + printf "checking for docker..." + command -v docker || { + echo "not found" + exit 1 + } + set -x + docker pull --platform "linux/$1" debian:stable + docker run --platform "linux/$1" -v "$(pwd):/ooni" -w /ooni debian:stable ./E2E/debian.sh install +} + +if [ "$1" = "docker" ]; then + test -n "$2" || { + echo "usage: $0 docker {i386,amd64,armhf,arm64}" 1>&2 + exit 1 + } + docker_flow "$2" + +elif [ "$1" = "install" ]; then + install_flow + +else + echo "usage: $0 docker {i386,amd64,armhf,arm64}" 1>&2 + echo " $0 install" 1>&2 + exit 1 +fi