Compare commits

...

3 Commits

Author SHA1 Message Date
Ken Matsui
1fd5c7ea5e
Remove macos-11 CI; not supported by Homebrew (#1891) 2023-12-28 22:29:45 +08:00
An Tao
2a0da80d5f
Avoid a race condition in database listener tests (#1890) 2023-12-28 19:23:42 +08:00
Ken Matsui
01ad18d2d5
Add CI tests with more compilers (#1889) 2023-12-28 15:59:29 +08:00
2 changed files with 54 additions and 13 deletions

View File

@ -66,8 +66,11 @@ jobs:
run: ./test.sh -w
macos:
name: macos/clang
runs-on: macos-latest
runs-on: macos-${{ matrix.osver }}
strategy:
fail-fast: false
matrix:
osver: [12, 13]
steps:
- name: Checkout Drogon source code
uses: actions/checkout@v4
@ -76,8 +79,8 @@ jobs:
fetch-depth: 0
- name: Install dependencies
# Already installed: brotli, zlib, postgresql@14, lz4, sqlite3
run: brew install ninja jsoncpp mariadb hiredis redis spdlog
# Already installed: brotli, zlib, lz4, sqlite3
run: brew install ninja jsoncpp mariadb hiredis redis spdlog postgresql@14
- name: Create Build Environment & Configure Cmake
# Some projects don't allow in-source building, so create a separate build directory
@ -114,18 +117,44 @@ jobs:
run: ./test.sh -t
ubuntu:
name: ${{ matrix.buildname }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
link: [SHARED, STATIC]
compiler:
- cxx: g++
ver: 9
- cxx: g++
ver: 10
- cxx: g++
ver: 11
- cxx: g++
ver: 12
- cxx: g++
ver: 13
- cxx: clang++
ver: 11
- cxx: clang++
ver: 12
- cxx: clang++
ver: 13
- cxx: clang++
ver: 14
- cxx: clang++
ver: 15
- cxx: clang++
ver: 16
- cxx: clang++
ver: 17
include:
- buildname: "ubuntu-22.04/gcc"
link: SHARED
- buildname: "ubuntu-22.04/gcc"
link: STATIC
- buildname: "ubuntu-22.04/coroutines"
link: STATIC
- link: STATIC
compiler:
cxx: g++
ver: 13
feature: coroutines
env:
CXX: ${{ matrix.compiler.cxx }}-${{ matrix.compiler.ver }}
steps:
- name: Checkout Drogon source code
uses: actions/checkout@v4
@ -147,6 +176,17 @@ jobs:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common postgresql-client-common
sudo apt-get -y install postgresql-all
- name: Install Clang
if: startsWith(matrix.compiler.cxx, 'clang') && matrix.compiler.ver < 13
run: sudo apt-get install clang-${{ matrix.compiler.ver }}
- name: Install Clang
if: startsWith(matrix.compiler.cxx, 'clang') && matrix.compiler.ver >= 13
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{ matrix.compiler.ver }}
- name: Export `shared`
run: |
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
@ -155,7 +195,7 @@ jobs:
- name: Create Build Environment & Configure Cmake
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
if: matrix.buildname != 'ubuntu-22.04/coroutines'
if: matrix.compiler.feature != 'coroutines'
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
@ -165,7 +205,7 @@ jobs:
- name: Create Build Environment & Configure Cmake (coroutines)
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
if: matrix.buildname == 'ubuntu-22.04/coroutines'
if: matrix.compiler.feature == 'coroutines'
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \

View File

@ -79,6 +79,7 @@ DROGON_TEST(ListenNotifyTest)
dbListener->unlisten(chan);
}
CHECK(numNotifications == 15);
std::this_thread::sleep_for(1s);
}
#endif