forked from scylladb/seastar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Test | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
test: | ||
name: "Tests (${{ matrix.compiler }}, C++${{ matrix.standard}}, ${{ matrix.mode }}, ${{ matrix.enables }})" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# only the compilers supported by setup-cpp | ||
compiler: [clang++-17, gcc-13] | ||
standard: [17, 20] | ||
mode: [dev, debug, release] | ||
include: | ||
- compiler: clang++-17 | ||
standard: 20 | ||
mode: release | ||
cooks: --cook dpdk | ||
enables: --enable-dpdk | ||
- compiler: clang++-17 | ||
standard: 20 | ||
mode: debug | ||
enables: --enable-cxx-modules | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "${{ contains(matrix.cooks, 'dpdk') }}" | ||
|
||
- name: Install build dependencies | ||
run: | | ||
sudo ./install-dependencies.sh | ||
# instal the latest cmake and ninja when building C++ modules | ||
- name: Install ${{ matrix.compiler }} | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
compiler: ${{ matrix.compiler }} | ||
ccache: true | ||
cmake: "${{ contains(matrix.enables, 'cxx-modules') }}" | ||
ninja: "${{ contains(matrix.enables, 'cxx-modules') }}" | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
key: ${{ matrix.compiler }}-${{ matrix.standard }}-${{ matrix.mode }} | ||
|
||
# setup-cpp exports env variables of CC and CXX, and update-alternatives | ||
# cc and cxx on ubuntu, so just point configure.py to cc and cxx | ||
- name: Configure | ||
run: > | ||
./configure.py | ||
--ccache | ||
--compiler cxx | ||
--c-compiler cc | ||
--c++-standard ${{ matrix.standard }} | ||
--mode ${{ matrix.mode }} | ||
${{ matrix.cooks }} | ||
${{ matrix.enables }} ; | ||
- name: Build | ||
run: cmake --build build/${{matrix.mode}} | ||
|
||
- name: Check Header | ||
if: ${{ matrix.mode == 'dev' }} | ||
run: cmake --build build/${{ matrix.mode }} --target checkheaders | ||
|
||
- name: Build with C++20 modules | ||
if: ${{ contains(matrix.enables, 'cxx-modules') }} | ||
run: cmake --build build/${{ matrix.mode }} --target hello_cxx_module | ||
|
||
- name: Test | ||
if: ${{ ! contains(matrix.enables, 'cxx-modules') }} | ||
run: ./test.py --mode=${{ matrix.mode }} |