commit d25087765ffb80fd8304efc3f1346fdb69861c7a from: Omar Polo date: Mon Jun 10 15:12:02 2024 UTC add .woodpecker.yml for codeberg' ci While here align alpine in .cirrus.yml too so we can easily reuse these scripts. commit - 47eaa0e007e02fd3af48c398d5409c303562b15c commit + d25087765ffb80fd8304efc3f1346fdb69861c7a blob - 88013ee8dd74b6d4080b30d804dcb3559c506cbc blob + da3b7c57d997c66bc4e242c4e23716d270833b22 --- .cirrus.yml +++ .cirrus.yml @@ -8,10 +8,9 @@ telescope_ubuntu_task: telescope_alpine_linux_task: container: image: alpine:latest - script: - - apk add git build-base bsd-compat-headers bison automake make autoconf libbsd-dev libressl-dev ncurses-dev - - .github/ci/build.sh - - make check + before_build_script: .github/ci/before-install.sh + build:script: .github/ci/build.sh + test_script: make check telescope_freebsd_task: freebsd_instance: blob - 291854b715e5dece665b4f7dd853f2f7cecea8c6 blob + 02ccce142666cd5863d2a19ddf21d7584ab169d5 --- .github/ci/before-install.sh +++ .github/ci/before-install.sh @@ -1,8 +1,23 @@ #!/bin/sh -if [ "$CIRRUS_OS" = "linux" ]; then - apt-get update -qq && \ - apt-get -y install bison autoconf \ +set -e + +case "$(uname)" in +*Linux*) + set +e + ID="$(. /etc/os-release && echo $ID)" + set -e + + case "$ID" in + alpine) + apk update + apk add alpine-sdk autoconf automake pkgconf make byacc \ + libbsd-dev ncurses-dev libretls-dev + ;; + *) + # assume debian-derived. + apt-get update -qq + apt-get -y install bison autoconf \ autotools-dev \ libncurses5-dev \ pkg-config \ @@ -11,17 +26,19 @@ if [ "$CIRRUS_OS" = "linux" ]; then libbsd-dev \ git \ libtls-dev -fi + ;; + esac + ;; -if [ "$CIRRUS_OS" = "freebsd" ]; then +*FreeBSD*) pkg install -y \ automake \ pkgconf \ git \ libretls -fi + ;; -if [ "$CIRRUS_OS" = "darwin" ]; then +*Darwin*) brew install autoconf \ automake \ bison \ @@ -30,4 +47,10 @@ if [ "$CIRRUS_OS" = "darwin" ]; then git \ libressl \ libretls -fi + ;; + +*) + echo "unknown operating system $(uname)" >&2 + exit 1 + ;; +esac blob - /dev/null blob + 9a9a8c0bff8a38312637538aa421905d35423492 (mode 644) --- /dev/null +++ .woodpecker.yaml @@ -0,0 +1,17 @@ +matrix: + TELESCOPE_BASE_IMAGE: + - alpine:latest + - debian:latest + +when: + - event: [tag, push, pull_request] + +steps: + - name: build + image: ${TELESCOPE_BASE_IMAGE} + commands: + - ./.github/ci/before-install.sh + - ./autogen.sh + - ./configure + - make + - make check