Skip to content

Commit

Permalink
ci: build project from the root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Nov 14, 2023
1 parent 4079f0f commit f939f10
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,91 +8,76 @@ on:
jobs:
debug:
runs-on: ubuntu-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure CMake
run: |
cmake ${{ matrix.package }} \
-B ${{ matrix.package }}/build \
cmake . \
-B build \
-D BUILD_TESTING=ON \
-D CHECK_FORMAT=ON \
-D CHECK_WARNING=ON \
-D CHECK_COVERAGE=ON
- name: Build project
run: cmake --build ${{ matrix.package }}/build
run: cmake --build build

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

- name: Check code coverage
uses: threeal/gcovr-action@main
with:
root: ${{ matrix.package }}
excludes: |
${{ matrix.package }}/build/*
${{ matrix.package }}/test/*
build/*
test/*
fail-under-line: 100

- name: Check diff
run: git diff --exit-code HEAD

debug-msvc:
runs-on: windows-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Configure CMake
run: |
cmake ${{ matrix.package }} `
-B ${{ matrix.package }}/build `
cmake . `
-B build `
-D CMAKE_CXX_COMPILER=cl `
-D BUILD_TESTING=ON `
-D CHECK_WARNING=ON
- name: Build project
run: cmake --build ${{ matrix.package }}/build
run: cmake --build build

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

release:
runs-on: ubuntu-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

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

release-msvc:
runs-on: windows-latest
strategy:
matrix:
package: [error]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

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

Expand Down

0 comments on commit f939f10

Please # to comment.