Skip to content

Commit

Permalink
feat(ci): expand C++ test coverage with multiple compilers
Browse files Browse the repository at this point in the history
Add debug and release builds for GCC and Clang on Ubuntu. Introduce
release builds and Clang tests for Windows. Enhance CI pipeline to
ensure broader compatibility and performance across environments.
  • Loading branch information
sinkingsugar committed Oct 9, 2024
1 parent f88bf09 commit 0ff53f9
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,29 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install g++
run: sudo apt-get update && sudo apt-get install -y g++
- name: Install g++ and clang
run: sudo apt-get update && sudo apt-get install -y g++ clang

- name: Compile and Run C++ Tests
- name: Compile and Run C++ Tests (Debug - GCC)
run: |
g++ -std=c++20 -g -o crdt tests.cpp && ./crdt
g++ -std=c++20 -g -o list-crdt list_tests.cpp && ./list-crdt
- name: Compile and Run C++ Tests (Release - GCC)
run: |
g++ -std=c++20 -O3 -DNDEBUG -o crdt_release tests.cpp && ./crdt_release
g++ -std=c++20 -O3 -DNDEBUG -o list-crdt_release list_tests.cpp && ./list-crdt_release
- name: Compile and Run C++ Tests (Debug - Clang)
run: |
clang++ -std=c++20 -g -o crdt_clang tests.cpp && ./crdt_clang
clang++ -std=c++20 -g -o list-crdt_clang list_tests.cpp && ./list-crdt_clang
- name: Compile and Run C++ Tests (Release - Clang)
run: |
clang++ -std=c++20 -O3 -DNDEBUG -o crdt_clang_release tests.cpp && ./crdt_clang_release
clang++ -std=c++20 -O3 -DNDEBUG -o list-crdt_clang_release list_tests.cpp && ./list-crdt_clang_release
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand Down Expand Up @@ -52,18 +67,30 @@ jobs:
with:
args: install llvm

- name: Compile and Run C++ Tests with MSVC
- name: Compile and Run C++ Tests with MSVC (Debug)
run: |
cl.exe /std:c++20 /EHsc /Fe:crdt.exe tests.cpp && .\crdt.exe
cl.exe /std:c++20 /EHsc /Fe:list-crdt.exe list_tests.cpp && .\list-crdt.exe
shell: cmd

- name: Compile and Run C++ Tests with Clang
- name: Compile and Run C++ Tests with MSVC (Release)
run: |
cl.exe /std:c++20 /EHsc /O2 /DNDEBUG /Fe:crdt_release.exe tests.cpp && .\crdt_release.exe
cl.exe /std:c++20 /EHsc /O2 /DNDEBUG /Fe:list-crdt_release.exe list_tests.cpp && .\list-crdt_release.exe
shell: cmd

- name: Compile and Run C++ Tests with Clang (Debug)
run: |
clang++ -std=c++20 -g -o crdt_clang.exe tests.cpp && .\crdt_clang.exe
clang++ -std=c++20 -g -o list-crdt_clang.exe list_tests.cpp && .\list-crdt_clang.exe
shell: cmd

- name: Compile and Run C++ Tests with Clang (Release)
run: |
clang++ -std=c++20 -O3 -DNDEBUG -o crdt_clang_release.exe tests.cpp && .\crdt_clang_release.exe
clang++ -std=c++20 -O3 -DNDEBUG -o list-crdt_clang_release.exe list_tests.cpp && .\list-crdt_clang_release.exe
shell: cmd

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand Down

0 comments on commit 0ff53f9

Please sign in to comment.