]> granicus.if.org Git - libevent/commitdiff
Add freebsd CI checks
authorneil <github@neilpang.com>
Sun, 7 Aug 2022 10:56:00 +0000 (18:56 +0800)
committerAzat Khuzhin <a3at.mail@gmail.com>
Mon, 8 Aug 2022 22:14:43 +0000 (00:14 +0200)
ci/linux skip
ci/macos skip
ci/windows skip
ci/mingw skip

.github/workflows/build.yml

index e49e5a63fc0bbe4d97ed2e2c58f72d416a4877b7..923d193e4c01d300d76a03d659a0a960ad9c91bd 100644 (file)
@@ -739,3 +739,176 @@ jobs:
         with:
           name: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-build
           path: build
+
+  freebsd-cmake-job:
+    runs-on: macos-12
+    if: "!contains(github.event.head_commit.message, 'ci/freebsd skip') && !contains(github.event.head_commit.message, 'ci/freebsd/cmake skip')"
+    strategy:
+      fail-fast: false
+      matrix:
+        release: ["12.3", "13.0", "13.1"]
+        EVENT_MATRIX:
+          - NONE
+          - NO_SSL
+          - DISABLE_OPENSSL
+          - DISABLE_THREAD_SUPPORT
+          - DISABLE_DEBUG_MODE
+          - DISABLE_MM_REPLACEMENT
+          - TEST_EXPORT_STATIC
+          - TEST_EXPORT_SHARED
+
+    steps:
+      - uses: actions/checkout@v2.0.0
+
+      - name: Cache Build
+        uses: actions/cache@v2
+        with:
+          path: build
+          key: freebsd-${{ matrix.release }}-cmake-${{ matrix.EVENT_MATRIX }}-v1
+
+      - name: Build
+        uses: vmactions/freebsd-vm@v0
+        with:
+          release: ${{ matrix.release }}
+          prepare: |
+            pkg install -y  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 freebsd 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: freebsd-${{ matrix.release }}-cmake-${{ matrix.EVENT_MATRIX }}-build
+          path: build
+
+  freebsd-autotools-job:
+    runs-on: macos-12
+    if: "!contains(github.event.head_commit.message, 'ci/freebsd skip') && !contains(github.event.head_commit.message, 'ci/freebsd/autotools skip')"
+    strategy:
+      fail-fast: false
+      matrix:
+        release: ["12.3", "13.0", "13.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: freebsd-${{ matrix.release }}-autotools-${{ matrix.EVENT_MATRIX }}-v1
+
+
+      - name: Build
+        uses: vmactions/freebsd-vm@v0
+        with:
+          release: ${{ matrix.release }}
+          prepare: |
+            pkg install -y  mbedtls  python3 autoconf automake libtool pkgconf
+          usesh: true
+          run: |
+            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
+
+      - name: Test
+        uses: nick-fields/retry@v2
+        with:
+          max_attempts: 5
+          timeout_minutes: 20
+          shell: bash
+          command: |
+            ssh freebsd sh <<EOF
+            JOBS=1
+            cd build
+            make -j $JOBS verify
+            EOF
+
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: freebsd-${{ matrix.release }}-autotools-${{ matrix.EVENT_MATRIX }}-build
+          path: build
+