-
Notifications
You must be signed in to change notification settings - Fork 39
50 lines (37 loc) · 1.3 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CMake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: RelWithDebInfo
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Upgrade cmake
run: brew upgrade cmake
- name: Install wget manually
run: brew install wget
- name: Install googletest manually
run: brew install googletest
- name: Install Clang-Format manually
run: brew install clang-format
- name: Find modified files and format
run: |
git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep '\.\(cpp\|cc\|h\|hpp\)$' | xargs clang-format -i
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply clang-format
branch: ${{ github.head_ref }}
file_pattern: '*.cpp *.h *.hpp *.cc'
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_MINISTL_TEST=ON -DCMAKE_CXX_FLAGS="-Werror"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Run test cases
working-directory: ${{github.workspace}}/build/Test
run: ./Test