Skip to content

Commit

Permalink
feat: update ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 19, 2023
1 parent cdc4d61 commit 7e4725f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,66 @@ on:
pull_request:

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Format
uses: cpp-linter/cpp-linter-action@v2
id: formatter
with:
version: 11
style: file
tidy-checks: '-*' # only formatting

- name: Fail?
if: steps.formatter.outputs.checks-failed > 0
run: echo "Some files failed the formatting checks!" && exit 1

lint:
needs: formatting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Conan build
run: |
conan profile detect --force
conan install . --output-folder=build --build=missing
- name: Build with CMake
run: |
cmake -S . -B build --preset conan-release -DCMAKE_BUILD_TYPE=Release
cmake --build build
- name: Lint
uses: cpp-linter/cpp-linter-action@v2
id: linter
with:
version: 11
style: file
tidy-checks: '' # use .clang-tidy
tidy-checks: '' # force the use of .clang-tidy
database: 'build'

- name: Fail test
- name: Fail?
if: steps.linter.outputs.checks-failed > 0
run: echo "Some files failed the linting checks!" && exit 1

test:
needs: lint
needs: formatting
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
if (MSVC)
add_compile_definitions(_USE_MATH_DEFINES)
endif ()
Expand Down

0 comments on commit 7e4725f

Please sign in to comment.