summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorneil <github@neilpang.com>2022-11-13 20:39:17 +0800
committerGitHub <noreply@github.com>2022-11-13 15:39:17 +0300
commit45c66e48795485407646e231b1f106412ce7b1ee (patch)
treedf2fe7be78817b36a6edf7405f50cf5c51197ef0 /.github
parent1af745d033678333752afcd8724f5d6351561b4e (diff)
downloadlibevent-45c66e48795485407646e231b1f106412ce7b1ee.tar.gz
Add CI checks for OpenBSD (#1326)
Initially 6.9 and 7.1 had been added, however due to some issues (you can read about them below) 6.9 had been disabled. netbsd 6.9 does not have correct library namings for autotools: 2022-08-17T04:59:58.8339420Z libtool: link: (cd ".libs" && rm -f "libevent.so.1.0" && ln -s "libevent-2.2.so.1.0" "libevent.so.1.0") $ grep ^library_names= libevent.la· library_names='libevent-2.2.so.1.0 libevent.so.1.0' # And this is wrong, it should be: libtool: link: (cd ".libs" && rm -f "libevent-2.2.so.1" && ln -s "libevent-2.2.so.1.0.0" "libevent-2.2.so.1") libtool: link: (cd ".libs" && rm -f "libevent.so" && ln -s "libevent-2.2.so.1.0.0" "libevent.so") library_names='libevent-2.2.so.1.0.0 libevent-2.2.so.1 libevent.so' **And I think that 7.1 should also fail, however it has system-wide libevent installed with evdns in the libevent.so** Also there are some issues with `TEST_EXPORT_SHARED` test, because of libraries naming: 2022-09-13T06:38:29.2150790Z [test-export] test for install tree(in system-wide path) 2022-09-13T06:38:29.2151500Z [test-export] fail: link core and run core expects success but gets failure. 2022-09-13T06:38:29.2063870Z /usr/bin/cc CMakeFiles/test-export.dir/test-export.c.o -o test-export -L/usr/local/lib -Wl,-z,origin,-rpath,/usr/local/lib -levent_core-2.2 -lpthread -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib· 2022-09-13T06:38:29.2152190Z ld: error: unable to find library -levent_core-2.2 2022-09-13T06:38:28.3915680Z -- Install configuration: "Release" 2022-09-13T06:38:28.3916700Z -- Up-to-date: /usr/local/lib/libevent_core-2.2.so.1.0.0 2022-09-13T06:38:28.3917110Z -- Up-to-date: /usr/local/lib/libevent_core-2.2.so.1 2022-09-13T06:38:28.3917480Z -- Up-to-date: /usr/local/lib/libevent_core.so # no libevent_core-2.2.so So I have to disable it too. Co-authored-by: Azat Khuzhin <azat@libevent.org>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml188
1 files changed, 188 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9a02f263..ad3a4d2b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -923,3 +923,191 @@ jobs:
name: freebsd-${{ matrix.release }}-autotools-${{ matrix.EVENT_MATRIX }}-build
path: build
+ openbsd-cmake-job:
+ runs-on: macos-12
+ if: "!contains(github.event.head_commit.message, 'ci/openbsd skip') && !contains(github.event.head_commit.message, 'ci/openbsd/cmake skip')"
+ strategy:
+ fail-fast: false
+ matrix:
+ release: [
+ # 6.9 has some issues with autoconf/autotools [1].
+ # [1]: https://github.com/libevent/libevent/pull/1326#issuecomment-1229531718
+ #"6.9",
+ "7.1",
+ ]
+ EVENT_MATRIX:
+ - NONE
+ - NO_SSL
+ - DISABLE_OPENSSL
+ - DISABLE_THREAD_SUPPORT
+ - DISABLE_DEBUG_MODE
+ - DISABLE_MM_REPLACEMENT
+ - TEST_EXPORT_STATIC
+ # For now this test is disabled due to incorrect library paths [1].
+ # [1]: https://github.com/libevent/libevent/pull/1326#issuecomment-1245159690
+ #
+ # - TEST_EXPORT_SHARED
+
+ steps:
+ - uses: actions/checkout@v2.0.0
+
+ - name: Cache Build
+ uses: actions/cache@v2
+ with:
+ path: build
+ key: openbsd-${{ matrix.release }}-cmake-${{ matrix.EVENT_MATRIX }}-v1
+
+ - name: Build
+ uses: vmactions/openbsd-vm@v0
+ with:
+ release: ${{ matrix.release }}
+ prepare: |
+ pkg_add mbedtls cmake python3
+ usesh: true
+ run: |
+ if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "NO_SSL" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON -DEVENT__DISABLE_MBEDTLS=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_THREAD_SUPPORT" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_THREAD_SUPPORT=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_DEBUG_MODE" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_DEBUG_MODE=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_MM_REPLACEMENT" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_MM_REPLACEMENT=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__LIBRARY_TYPE=STATIC -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
+ EVENT_CMAKE_OPTIONS="-DEVENT__LIBRARY_TYPE=SHARED -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON"
+
+ else
+ EVENT_CMAKE_OPTIONS=""
+ fi
+ EVENT_CMAKE_OPTIONS="$EVENT_CMAKE_OPTIONS -DMBEDTLS_ROOT_DIR=/usr/local/opt/mbedtls@2"
+
+ mkdir -p build
+ cd build
+ echo [cmake]: cmake .. $EVENT_CMAKE_OPTIONS
+ cmake .. $EVENT_CMAKE_OPTIONS || (rm -rf * && cmake .. $EVENT_CMAKE_OPTIONS)
+ cmake --build .
+
+ - name: Test
+ uses: nick-fields/retry@v2
+ with:
+ max_attempts: 5
+ timeout_minutes: 20
+ shell: bash
+ command: |
+ ssh openbsd sh <<EOF
+ cd $GITHUB_WORKSPACE
+ JOBS=1
+ export CTEST_PARALLEL_LEVEL=$JOBS
+ export CTEST_OUTPUT_ON_FAILURE=1
+ cd build
+ if [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
+ python3 ../test-export/test-export.py static
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
+ python3 ../test-export/test-export.py shared
+ else
+ cmake --build . --target verify
+ fi
+ EOF
+
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: openbsd-${{ matrix.release }}-cmake-${{ matrix.EVENT_MATRIX }}-build
+ path: .
+
+ openbsd-autotools-job:
+ runs-on: macos-12
+ if: "!contains(github.event.head_commit.message, 'ci/openbsd skip') && !contains(github.event.head_commit.message, 'ci/openbsd/autotools skip')"
+ strategy:
+ fail-fast: false
+ matrix:
+ release: [
+ # 6.9 has some issues with autoconf/autotools [1].
+ # [1]: https://github.com/libevent/libevent/pull/1326#issuecomment-1229531718
+ #"6.9",
+ "7.1",
+ ]
+ EVENT_MATRIX:
+ - NONE
+ - NO_SSL
+ - DISABLE_OPENSSL
+ - DISABLE_THREAD_SUPPORT
+ - DISABLE_DEBUG_MODE
+ - DISABLE_MM_REPLACEMENT
+
+ steps:
+ - uses: actions/checkout@v2.0.0
+
+ - name: Cache Build
+ uses: actions/cache@v2
+ with:
+ path: build
+ key: openbsd-${{ matrix.release }}-autotools-${{ matrix.EVENT_MATRIX }}-v1
+
+
+ - name: Build
+ uses: vmactions/openbsd-vm@v0
+ with:
+ release: ${{ matrix.release }}
+ prepare: |
+ pkg_add mbedtls python3 automake-1.16.3 autoconf-2.71 libtool pkgconf
+ usesh: true
+ run: |
+ export AUTOMAKE_VERSION=1.16
+ export AUTOCONF_VERSION=2.71
+
+ if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
+ EVENT_CONFIGURE_OPTIONS="--disable-openssl"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "NO_SSL" ]; then
+ EVENT_CONFIGURE_OPTIONS="--disable-openssl --disable-mbedtls"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_THREAD_SUPPORT" ]; then
+ EVENT_CONFIGURE_OPTIONS="--disable-thread-support"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_DEBUG_MODE" ]; then
+ EVENT_CONFIGURE_OPTIONS="--disable-debug-mode"
+
+ elif [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_MM_REPLACEMENT" ]; then
+ EVENT_CONFIGURE_OPTIONS="--disable-malloc-replacement"
+
+ else
+ EVENT_CONFIGURE_OPTIONS=""
+ fi
+
+ ./autogen.sh
+ mkdir -p build
+ cd build
+ echo [configure]: ../configure $EVENT_CONFIGURE_OPTIONS
+ ../configure $EVENT_CONFIGURE_OPTIONS
+ make V=1
+
+ - name: Test
+ uses: nick-fields/retry@v2
+ with:
+ max_attempts: 5
+ timeout_minutes: 20
+ shell: bash
+ command: |
+ ssh openbsd sh <<EOF
+ cd $GITHUB_WORKSPACE
+ JOBS=1
+ cd build
+ make verify
+ EOF
+
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: openbsd-${{ matrix.release }}-autotools-${{ matrix.EVENT_MATRIX }}-build
+ path: .