mirror of
https://github.com/qicosmos/rest_rpc.git
synced 2026-08-29 16:40:48 +08:00
add ci
This commit is contained in:
@@ -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 }}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user