Skip to content

Commit f939f10

Browse files
committed
ci: build project from the root directory
1 parent 4079f0f commit f939f10

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,91 +8,76 @@ on:
88
jobs:
99
debug:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
package: [error]
1411
steps:
1512
- name: Checkout repository
1613
uses: actions/checkout@v4.1.1
1714

1815
- name: Configure CMake
1916
run: |
20-
cmake ${{ matrix.package }} \
21-
-B ${{ matrix.package }}/build \
17+
cmake . \
18+
-B build \
2219
-D BUILD_TESTING=ON \
2320
-D CHECK_FORMAT=ON \
2421
-D CHECK_WARNING=ON \
2522
-D CHECK_COVERAGE=ON
2623
2724
- name: Build project
28-
run: cmake --build ${{ matrix.package }}/build
25+
run: cmake --build build
2926

3027
- name: Run unit tests
31-
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
28+
run: ctest --test-dir build --output-on-failure --no-tests=error
3229

3330
- name: Check code coverage
3431
uses: threeal/gcovr-action@main
3532
with:
36-
root: ${{ matrix.package }}
3733
excludes: |
38-
${{ matrix.package }}/build/*
39-
${{ matrix.package }}/test/*
34+
build/*
35+
test/*
4036
fail-under-line: 100
4137

4238
- name: Check diff
4339
run: git diff --exit-code HEAD
4440

4541
debug-msvc:
4642
runs-on: windows-latest
47-
strategy:
48-
matrix:
49-
package: [error]
5043
steps:
5144
- name: Checkout repository
5245
uses: actions/checkout@v4.1.1
5346

5447
- name: Configure CMake
5548
run: |
56-
cmake ${{ matrix.package }} `
57-
-B ${{ matrix.package }}/build `
49+
cmake . `
50+
-B build `
5851
-D CMAKE_CXX_COMPILER=cl `
5952
-D BUILD_TESTING=ON `
6053
-D CHECK_WARNING=ON
6154
6255
- name: Build project
63-
run: cmake --build ${{ matrix.package }}/build
56+
run: cmake --build build
6457

6558
- name: Run unit tests
66-
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
59+
run: ctest --test-dir build --output-on-failure --no-tests=error
6760

6861
release:
6962
runs-on: ubuntu-latest
70-
strategy:
71-
matrix:
72-
package: [error]
7363
steps:
7464
- name: Checkout repository
7565
uses: actions/checkout@v4.1.1
7666

7767
- name: Configure and build project
7868
uses: threeal/cmake-action@v1.3.0
7969
with:
80-
source-dir: ${{ matrix.package }}
8170
run-build: true
8271

8372
release-msvc:
8473
runs-on: windows-latest
85-
strategy:
86-
matrix:
87-
package: [error]
8874
steps:
8975
- name: Checkout repository
9076
uses: actions/checkout@v4.1.1
9177

9278
- name: Configure and build project
9379
uses: threeal/cmake-action@v1.3.0
9480
with:
95-
source-dir: ${{ matrix.package }}
9681
cxx-compiler: cl
9782
run-build: true
9883

0 commit comments

Comments
 (0)