Skip to content

Commit

Permalink
[build] add .github workflow
Browse files Browse the repository at this point in the history
Change-Id: I8377f42da3d28ae1d2593ac5ab9ba1c1f1d97074
  • Loading branch information
stbuehler committed Jan 13, 2024
1 parent d9e4b2e commit 2b4e6d3
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci-alpine.yml
Original file line number Diff line number Diff line change
@@ -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
67 changes: 67 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -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
52 changes: 52 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -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
[email protected]
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

0 comments on commit 2b4e6d3

Please sign in to comment.