This commit is contained in:
Jacyking
2023-03-20 16:29:45 +08:00
parent 68e7bc11e5
commit ff0c6dca86
6 changed files with 50 additions and 333 deletions
+24
View File
@@ -0,0 +1,24 @@
name: CI
on: [ push, pull_request ]
jobs:
build:
name: ${{ matrix.os }} (${{ matrix.configuration }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
configuration: [ Debug, Release ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Configure cmake
run: cmake -B${{github.workspace}}/examples/build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- name: Build with ${{ matrix.compiler }}
run: cmake --build ${{github.workspace}}/examples/build --config ${{ matrix.configuration }}
+26
View File
@@ -0,0 +1,26 @@
name: Clang Format Diff
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install clang-format
run: sudo apt install clang-format
- name: check-diff
run: |
diff=`git-clang-format --diff HEAD^`
if ! [[ "$diff" = "no modified files to format" || "$diff" = "clang-format did not modify any files" ]]; then
echo "The diff you sent is not formatted correctly."
echo "The suggested format is"
echo "$diff"
exit 1
fi