From 4f662d662ee4331c7829604804b5a91be92afd74 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 7 Aug 2022 18:56:00 +0800 Subject: [PATCH] Add freebsd CI checks ci/linux skip ci/macos skip ci/windows skip ci/mingw skip --- .github/workflows/build.yml | 173 ++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e49e5a63fc..923d193e4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 <