Skip to content

Commit

Permalink
Add freebsd CI checks
Browse files Browse the repository at this point in the history
ci/linux skip
ci/macos skip
ci/windows skip
ci/mingw skip
  • Loading branch information
Neilpang authored and azat committed Aug 8, 2022
1 parent 80c1e0b commit 4f662d6
Showing 1 changed file with 173 additions and 0 deletions.
173 changes: 173 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

- 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/[email protected]

- 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

0 comments on commit 4f662d6

Please sign in to comment.