Skip to content

Commit 0b5098f

Browse files
committed
Add debug/release variants and gcc/clang compilers to CI
1 parent cb54db1 commit 0b5098f

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

.github/workflows/libenvpp_ci.yml

+37-8
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,57 @@ name: Libenvpp CI
22

33
on: [push, pull_request]
44

5-
env:
6-
BUILD_TYPE: Debug
7-
85
jobs:
96
build-and-test:
107
strategy:
118
matrix:
9+
build-type: [Debug, Release]
10+
compiler: [g++, clang++]
1211
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest]
1312

1413
runs-on: ${{ matrix.os }}
1514

1615
steps:
17-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Configure CMake
21+
run: cmake -B ${{ github.workspace }}/build_${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
22+
23+
- name: Build
24+
run: cmake --build ${{ github.workspace }}/build_${{ matrix.compiler }} --config ${{ matrix.build-type }}
25+
26+
- name: Run tests
27+
working-directory: ${{ github.workspace }}/build_${{ matrix.compiler }}
28+
run: ctest -C ${{ matrix.build-type }}
29+
30+
build-and-test-mingw:
31+
strategy:
32+
matrix:
33+
build-type: [Debug, Release]
34+
compiler: [g++, clang++]
35+
os: [windows-latest]
36+
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- uses: msys2/setup-msys2@v2
41+
with:
42+
install: mingw-w64-x86_64-cmake
43+
- uses: actions/checkout@v4
1844
with:
1945
submodules: recursive
2046

2147
- name: Configure CMake
22-
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
48+
shell: msys2 {0}
49+
run: cmake -B ${{ github.workspace }}/build_${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
2350

2451
- name: Build
25-
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
52+
shell: msys2 {0}
53+
run: cmake --build ${{ github.workspace }}/build_${{ matrix.compiler }} --config ${{ matrix.build-type }}
2654

2755
- name: Run tests
28-
working-directory: ${{ github.workspace }}/build
29-
run: ctest -C ${{ env.BUILD_TYPE }}
56+
shell: msys2 {0}
57+
working-directory: ${{ github.workspace }}/build_${{ matrix.compiler }}
58+
run: ctest -C ${{ matrix.build-type }}

0 commit comments

Comments
 (0)