From 2b4e6d3a4d2840b0d9710563f63059ac2d2916f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sat, 13 Jan 2024 15:23:51 +0100 Subject: [PATCH] [build] add .github workflow Change-Id: I8377f42da3d28ae1d2593ac5ab9ba1c1f1d97074 --- .github/workflows/ci-alpine.yml | 50 ++++++++++++++++++++++++ .github/workflows/ci-linux.yml | 67 +++++++++++++++++++++++++++++++++ .github/workflows/ci-macos.yml | 52 +++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 .github/workflows/ci-alpine.yml create mode 100644 .github/workflows/ci-linux.yml create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-alpine.yml b/.github/workflows/ci-alpine.yml new file mode 100644 index 00000000..f5dc03ac --- /dev/null +++ b/.github/workflows/ci-alpine.yml @@ -0,0 +1,50 @@ +name: "Checks (alpine, many platforms)" + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + linux-alpine: + runs-on: ubuntu-latest + name: linux-alpine-${{ matrix.platform }} + # abort if x86_64 fails + continue-on-error: ${{ matrix.platform != 'x86_64' }} + strategy: + fail-fast: true + matrix: + platform: ['x86_64','x86','armhf','armv7','aarch64','ppc64le','riscv64','s390x'] + steps: + - uses: actions/checkout@v4 + - uses: jirutka/setup-alpine@v1 + with: + # riscv64 currently requires 'edge' + branch: edge + arch: ${{ matrix.platform }} + packages: > + build-base + meson + libev-dev + ragel + glib-dev + lua5.1-dev + zlib-dev + bzip2-dev + pkgconf + openssl-dev + gnutls-dev + libidn-dev + libunwind-dev + python3 + py3-curl + - name: meson setup + shell: alpine.sh {0} + run: meson setup mesonbuilddir + - name: meson compile + shell: alpine.sh {0} + run: meson compile -C mesonbuilddir + - name: meson test + shell: alpine.sh {0} + run: meson test -C mesonbuilddir -v diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 00000000..0913306f --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,67 @@ +name: "Checks (Ubuntu: gcc+clang)" + +on: [push, pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.head_ref}} + cancel-in-progress: true + +jobs: + linux-build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + pkgs=( + ruby + ruby-nokogiri + ruby-kramdown + libxml2-utils + ) + sudo apt-get install "${pkgs[@]}" + - name: Build docs + run: | + mkdir -p out + ruby doc/compile.rb out + cp doc/*.css doc/*.js out + - uses: actions/upload-artifact@v4 + with: + name: lighttpd2-docs + path: out + + linux-ubuntu: + runs-on: ubuntu-latest + name: linux-ubuntu-${{ matrix.compiler }} + strategy: + matrix: + compiler: ['gcc', 'clang'] + steps: + - uses: actions/checkout@v4 + - if: ${{ matrix.compiler == 'clang' }} + uses: egor-tensin/setup-clang@v1 + - name: Install dependencies + run: | + pkgs=( + meson + libev-dev + ragel + libglib2.0-dev + liblua5.1-dev + zlib1g-dev + libbz2-dev + pkg-config + libssl-dev + libgnutls28-dev + libidn-dev + libunwind8-dev + python3 + python3-pycurl + ) + sudo apt-get install "${pkgs[@]}" + - name: meson setup + run: meson setup mesonbuilddir + - name: meson compile + run: meson compile -C mesonbuilddir + - name: meson test + run: meson test -C mesonbuilddir -v diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 00000000..4473d5ac --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,52 @@ +name: "Checks (macOS)" + +on: [push, pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.head_ref}} + cancel-in-progress: true + +jobs: + macOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + pkgs=( + meson + libev + ragel + glib + lua@5.1 + zlib + bzip2 + openssl@3 + gnutls + libidn + python3 + python-pycurl + md5sha1sum + ) + brew install "${pkgs[@]}" + - name: meson setup + run: meson setup -D unwind=false mesonbuilddir + - name: meson compile + run: meson compile -C mesonbuilddir + - name: prepare environment for tests + run: | + sudo ifconfig lo0 alias 127.0.0.2 up + + # try to create a tmpdir with a short relative path (for shorter unix socket paths) + NEWTMPDIR=~/tmp + ln -sf "${TMPDIR}" "${NEWTMPDIR}" + echo "TMPDIR=$NEWTMPDIR" >> "$GITHUB_ENV" + echo "PATH=$(brew --prefix python)/libexec/bin:$PATH" >> "$GITHUB_ENV" + + if [ ! -f $(brew --prefix python)/libexec/bin/python3 ]; then + # the brew path only provides "python", not "python3"... + ln -s python $(brew --prefix python)/libexec/bin/python3 + fi + - name: meson test + run: | + meson test -C mesonbuilddir -v