Backport github actions to 2.1

With some modifications:
- drop coverage
- drop doxygen
- do not deploy ABI check, only artifacts
This commit is contained in:
Azat Khuzhin 2020-06-28 21:39:33 +03:00
parent 4d3ff29cac
commit be3acd7c08
7 changed files with 850 additions and 0 deletions

41
.github/workflows/abi.yml vendored Normal file
View File

@ -0,0 +1,41 @@
---
name: abi
on:
push:
branches:
- patches-2.1
tags:
- release-*
jobs:
abi:
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2.0.0
- name: Install Dependencies
run:
sudo apt install
abi-tracker
abi-monitor
abi-dumper
abi-compliance-checker
pkgdiff
vtable-dumper
- name: Generate
shell: bash
run: |
./extra/abi-check/abi_check.sh
env:
ABI_CHECK_ROOT: /tmp/le-abi-root
- uses: actions/upload-artifact@v1
with:
name: build
path: /tmp/le-abi-root/work/abi-check

210
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,210 @@
---
name: linux
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
jobs:
cmake:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
EVENT_MATRIX:
- DIST
- NONE
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- COMPILER_CLANG
- TEST_EXPORT_STATIC
- TEST_EXPORT_SHARED
- ASAN
- TSAN
- UBSAN
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Build
uses: actions/cache@v1.1.0
with:
path: build
key: ${{ matrix.os }}-cmake-${{ matrix.EVENT_MATRIX }}-v2
- name: Cache Dist Build
uses: actions/cache@v1.1.0
with:
path: dist
key: ${{ matrix.os }}-cmake-dist-${{ matrix.EVENT_MATRIX }}-v2
- name: Build And Test
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
./autogen.sh
mkdir -p dist
cd dist
../configure
rm -fr *.tar.gz
make dist
archive=$(echo *.tar.gz)
tar -vxf $archive
cd $(basename $archive .tar.gz)
fi
export TSAN_OPTIONS=suppressions=$PWD/extra/tsan.supp
export LSAN_OPTIONS=suppressions=$PWD/extra/lsan.supp
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=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 }}" == "COMPILER_CLANG" ]; then
EVENT_CMAKE_OPTIONS=""
export CC=clang
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"
elif [ "${{ matrix.EVENT_MATRIX }}" == "ASAN" ]; then
EVENT_CMAKE_OPTIONS="-DCMAKE_C_FLAGS=-fsanitize=address -DCMAKE_C_COMPILER=clang"
elif [ "${{ matrix.EVENT_MATRIX }}" == "TSAN" ]; then
EVENT_CMAKE_OPTIONS="-DCMAKE_C_FLAGS=-fsanitize=thread -DCMAKE_C_COMPILER=clang"
elif [ "${{ matrix.EVENT_MATRIX }}" == "UBSAN" ]; then
EVENT_CMAKE_OPTIONS="-DCMAKE_C_FLAGS=-fsanitize=undefined -DCMAKE_C_COMPILER=clang"
else
EVENT_CMAKE_OPTIONS=""
fi
#run build and test
JOBS=20
export CTEST_PARALLEL_LEVEL=$JOBS
export CTEST_OUTPUT_ON_FAILURE=1
mkdir -p build
cd build
echo [cmake]: cmake .. $EVENT_CMAKE_OPTIONS
cmake .. $EVENT_CMAKE_OPTIONS || (rm -rf * && cmake .. $EVENT_CMAKE_OPTIONS)
cmake --build .
if [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
sudo python3 ../test-export/test-export.py static
elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
sudo python3 ../test-export/test-export.py shared
else
cmake --build . --target verify
fi
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-cmake-${{ matrix.EVENT_MATRIX }}-build
path: build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-cmake-${{ matrix.EVENT_MATRIX }}-dist
path: dist
autotools:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
EVENT_MATRIX:
- DIST
- NONE
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- COMPILER_CLANG
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Build
uses: actions/cache@v1.1.0
with:
path: build
key: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-v2
- name: Cache Dist Build
uses: actions/cache@v1.1.0
with:
path: dist
key: ${{ matrix.os }}-autotools-dist-${{ matrix.EVENT_MATRIX }}-v2
- name: Build And Test
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
EVENT_CONFIGURE_OPTIONS="--disable-openssl"
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"
elif [ "${{ matrix.EVENT_MATRIX }}" == "COMPILER_CLANG" ]; then
EVENT_CONFIGURE_OPTIONS=""
export CC=clang
else
EVENT_CONFIGURE_OPTIONS=""
fi
#run build and test
JOBS=20
./autogen.sh
if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
mkdir -p dist
cd dist
rm -fr *.tar.gz
../configure $EVENT_CONFIGURE_OPTIONS
make dist
archive=$(echo *.tar.gz)
tar -vxf $archive
cd $(basename $archive .tar.gz)
fi
mkdir -p build
cd build
echo [configure]: ../configure $EVENT_CONFIGURE_OPTIONS
../configure $EVENT_CONFIGURE_OPTIONS
make
make -j $JOBS verify
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-build
path: build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-dist
path: dist

168
.github/workflows/macos.yml vendored Normal file
View File

@ -0,0 +1,168 @@
---
name: macos
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
jobs:
cmake:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [macos-latest]
EVENT_MATRIX:
- NONE
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- TEST_EXPORT_STATIC
- TEST_EXPORT_SHARED
- OPENSSL_1_1
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Build
uses: actions/cache@v1.1.0
with:
path: build
key: macos-10.15-cmake-${{ matrix.EVENT_MATRIX }}-v2
- name: Build And Test
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
else
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
fi
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=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
#run build and test
JOBS=1
export CTEST_PARALLEL_LEVEL=$JOBS
export CTEST_OUTPUT_ON_FAILURE=1
mkdir -p build
cd build
echo [cmake]: cmake .. $EVENT_CMAKE_OPTIONS
cmake .. $EVENT_CMAKE_OPTIONS || (rm -rf * && cmake .. $EVENT_CMAKE_OPTIONS)
cmake --build .
if [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
sudo python3 ../test-export/test-export.py static
elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
sudo python3 ../test-export/test-export.py shared
else
cmake --build . --target verify
fi
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-cmake-${{ matrix.EVENT_MATRIX }}-build
path: build
autotools:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [macos-latest]
EVENT_MATRIX:
- NONE
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- OPENSSL_1_1
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Build
uses: actions/cache@v1.1.0
with:
path: build
key: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-v2
- name: Install Depends
run: brew install autoconf automake libtool pkg-config
- name: Build And Test
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
else
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
EVENT_CONFIGURE_OPTIONS="--disable-openssl"
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
#run build and test
JOBS=1
./autogen.sh
mkdir -p build
cd build
echo [configure]: ../configure $EVENT_CONFIGURE_OPTIONS
../configure $EVENT_CONFIGURE_OPTIONS
make
make -j $JOBS verify
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-build
path: build

170
.github/workflows/mingw.yml vendored Normal file
View File

@ -0,0 +1,170 @@
---
name: mingw
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
jobs:
autotools:
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
EVENT_MATRIX:
- none
- disable-openssl
- disable-thread-support
- disable-debug-mode
- disable-malloc-replacement
steps:
- uses: actions/checkout@v2.0.0
- name: Cache MinGW
id: cache-mingw
uses: actions/cache@v1.1.2
with:
path: D:\a\_temp\msys
key: windows-mingw
- name: Cache Build
uses: actions/cache@v1.1.2
with:
path: build
key: mingw-autotools-${{ matrix.EVENT_MATRIX }}-v2
- uses: numworks/setup-msys2@v1
if: steps.cache-mingw.outputs.cache-hit != 'true'
with:
msystem: MINGW64
- name: Install Dependes
if: steps.cache-mingw.outputs.cache-hit != 'true'
run: |
msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc autoconf automake libtool mingw-w64-x86_64-openssl
- name: Build And Test
shell: powershell
run: |
$env:EVENT_CONFIGURE_OPTIONS=""
if ( "${{ matrix.EVENT_MATRIX }}" -ne "none" ) {
$env:EVENT_CONFIGURE_OPTIONS="--${{ matrix.EVENT_MATRIX }}"
}
$env:EVENT_TESTS_PARALLEL=1
$env:EVENT_BUILD_PARALLEL=10
$script='
export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH"
./autogen.sh 2>&1 3>&1
[[ $? -ne 0 ]] && exit 1
mkdir -p build
cd build
[[ $? -ne 0 ]] && exit 1
LDFLAGS="-L/mingw64/lib" CFLAGS="-I/mingw64/include" ../configure $EVENT_CONFIGURE_OPTIONS 2>&1
[[ $? -ne 0 ]] && exit 1
make -j $EVENT_BUILD_PARALLEL 2>&1
[[ $? -ne 0 ]] && exit 1
make verify -j $EVENT_TESTS_PARALLEL 2>&1 '
D:\a\_temp\msys\msys64\usr\bin\bash.exe -c $script
- uses: actions/upload-artifact@v1
if: failure()
with:
name: mingw-${{ matrix.EVENT_MATRIX }}-build
path: build
cmake:
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
EVENT_MATRIX:
- NONE
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
steps:
- uses: actions/checkout@v2.0.0
- name: Cache MinGW
id: cache-mingw-cmake
uses: actions/cache@v1.1.2
with:
path: D:\a\_temp\msys
key: windows-mingw-cmake
- name: Cache Build
uses: actions/cache@v1.1.2
with:
path: build
key: mingw-cmake-${{ matrix.EVENT_MATRIX }}-v2
- uses: numworks/setup-msys2@v1
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
with:
msystem: MINGW64
- name: Install Dependes
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
run: |
msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl
- name: Build And Test
shell: powershell
run: |
$EVENT_CONFIGURE_OPTIONS=""
if ( "${{ matrix.EVENT_MATRIX }}" -ne "NONE" ) {
$EVENT_CONFIGURE_OPTIONS="-DEVENT__${{ matrix.EVENT_MATRIX }}=ON"
}
$env:PATH="D:\a\_temp\msys\msys64\mingw64\bin;D:\a\_temp\msys\msys64\usr\bin;$env:PATH"
mkdir build -ea 0
cd build
function cmake_configure($retry)
{
$errcode=0
try {
cmake .. -G "MSYS Makefiles" $EVENT_CONFIGURE_OPTIONS -DCMAKE_C_FLAGS=-w
$errcode=$LastExitCode
}
catch {
$errcode=1
}
finally {
if ($errcode -ne 0) {
if ($retry -eq 0) {
$host.SetShouldExit($LastExitCode)
} else {
echo "Remove all entries in build directory"
rm -r -fo *
cmake_configure 0
}
}
}
}
cmake_configure 1
cmake --build .
ctest -V
- uses: actions/upload-artifact@v1
if: failure()
with:
name: mingw-${{ matrix.EVENT_MATRIX }}-build
path: build

256
.github/workflows/windows.yml vendored Normal file
View File

@ -0,0 +1,256 @@
---
name: windows
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
jobs:
vs2017:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [windows-2016]
EVENT_MATRIX: [NONE]
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Depends
id: cache-depends
uses: actions/cache@v1.0.3
with:
path: C:\vcpkg\installed
key: ${{ matrix.os }}-vcpkg
- name: Cache Build
uses: actions/cache@v1.0.3
with:
path: build
key: ${{ matrix.os }}-${{ matrix.EVENT_MATRIX }}-v3
- name: Install Depends
if: steps.cache-depends.outputs.cache-hit != 'true'
shell: powershell
run: |
vcpkg install openssl:x64-windows
vcpkg install zlib:x64-windows
- name: Build And Test
shell: powershell
run: |
$OPENSSL_ROOT_DIR="C:\vcpkg\installed\x64-windows"
$EVENT_BUILD_PARALLEL=10
$EVENT_TESTS_PARALLEL=1
$env:PATH="$OPENSSL_ROOT_DIR/bin;$env:PATH"
mkdir build -ea 0
cd build
$CMAKE_CMD="cmake -G 'Visual Studio 15 2017 Win64' .."
function cmake_configure($retry)
{
$errcode=0
try {
if ($retry -eq 0) {
echo "[cmake configure retry] $CMAKE_CMD"
} else {
echo "[cmake configure] $CMAKE_CMD"
}
Invoke-Expression $CMAKE_CMD
$errcode=$LastExitCode
}
catch {
$errcode=1
}
finally {
if ($errcode -ne 0) {
if ($retry -eq 0) {
$host.SetShouldExit($LastExitCode)
} else {
echo "Remove all entries in build directory"
rm -r -fo *
cmake_configure 0
}
}
}
}
cmake_configure 1
try {
cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
if ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_STATIC") {
python ../test-export/test-export.py static
}
elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
python ../test-export/test-export.py shared
}
else {
ctest --output-on-failure -j $EVENT_TESTS_PARALLEL
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
}
} catch {
$host.SetShouldExit($LastExitCode)
}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-${{ matrix.EVENT_MATRIX }}-build
path: build
vs2019:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
os: [windows-2019]
EVENT_MATRIX:
- NONE
- LIBRARY_TYPE_STATIC
- DISABLE_OPENSSL
- DISABLE_THREAD_SUPPORT
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- DUNICODE
- TEST_EXPORT_SHARED
- TEST_EXPORT_STATIC
steps:
- uses: actions/checkout@v2.0.0
- name: Cache Depends
id: cache-depends
uses: actions/cache@v1.1.0
with:
path: C:\vcpkg\installed
key: ${{ matrix.os }}-vcpkg
- name: Cache Build
uses: actions/cache@v1.1.0
with:
path: build
key: ${{ matrix.os }}-${{ matrix.EVENT_MATRIX }}-v3
- name: Install Depends
if: steps.cache-depends.outputs.cache-hit != 'true'
shell: powershell
run: |
vcpkg install openssl:x64-windows
vcpkg install zlib:x64-windows
- name: Build And Test
shell: powershell
run: |
$OPENSSL_ROOT_DIR="C:\vcpkg\installed\x64-windows"
$EVENT_BUILD_PARALLEL=10
$EVENT_TESTS_PARALLEL=1
$env:PATH="$OPENSSL_ROOT_DIR/bin;$env:PATH"
if ( "${{ matrix.EVENT_MATRIX }}" -eq "LIBRARY_TYPE_STATIC" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__LIBRARY_TYPE=STATIC"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "DISABLE_OPENSSL" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "DISABLE_THREAD_SUPPORT" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_THREAD_SUPPORT=ON"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "DISABLE_DEBUG_MODE" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_DEBUG_MODE=ON"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "DISABLE_MM_REPLACEMENT" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_MM_REPLACEMENT=ON"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "UNICODE" ) {
$EVENT_CMAKE_OPTIONS="-DCMAKE_C_FLAGS='-DUNICODE -D_UNICODE'"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON"
}
elseif ( "${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_STATIC" ) {
$EVENT_CMAKE_OPTIONS="-DEVENT__LIBRARY_TYPE=STATIC -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_SAMPLES=ON"
}
else {
$EVENT_CMAKE_OPTIONS=""
}
mkdir build -ea 0
cd build
if ("${{ matrix.os }}" -eq "windows-2016") {
$CMAKE_CMD="cmake -G 'Visual Studio 15 2017 Win64' .."
}
else { # windows-2019
$CMAKE_CMD="cmake -G 'Visual Studio 16 2019' -A x64 .. $EVENT_CMAKE_OPTIONS"
}
function cmake_configure($retry)
{
$errcode=0
try {
if ($retry -eq 0) {
echo "[cmake configure retry] $CMAKE_CMD"
} else {
echo "[cmake configure] $CMAKE_CMD"
}
Invoke-Expression $CMAKE_CMD
$errcode=$LastExitCode
}
catch {
$errcode=1
}
finally {
if ($errcode -ne 0) {
if ($retry -eq 0) {
$host.SetShouldExit($LastExitCode)
} else {
echo "Remove all entries in build directory"
rm -r -fo *
cmake_configure 0
}
}
}
}
cmake_configure 1
try {
cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
if ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_STATIC") {
python ../test-export/test-export.py static
}
elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
python ../test-export/test-export.py shared
}
else {
ctest --output-on-failure -j $EVENT_TESTS_PARALLEL
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
}
} catch {
$host.SetShouldExit($LastExitCode)
}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-${{ matrix.EVENT_MATRIX }}-build
path: build

3
extra/lsan.supp Normal file
View File

@ -0,0 +1,3 @@
# TODO: temporary, until tests itself will be fixed
leak:libcrypto.so
leak:libssl.so

2
extra/tsan.supp Normal file
View File

@ -0,0 +1,2 @@
# https://github.com/libevent/libevent/issues/777
race:event_debug_mode_too_late