Skip to content

Commit 91b1eaa

Browse files
committed
CI 增加 clang-format、XMake 的检查
1 parent 577c66f commit 91b1eaa

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/build_and_test.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@ name: build and test
22

33
on:
44
push:
5-
branches: ["main", "ci-test"]
5+
branches: [ "main", "ci-test" ]
66
pull_request:
7-
branches: ["main"]
7+
branches: [ "main" ]
88

99
jobs:
10-
ctest:
10+
on-ubuntu:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: setup deps
15-
run: sudo apt upgrade && sudo apt install build-essential cmake
16-
- name: cmake
17-
run: mkdir build && cmake -S . -B build -DEMDEVIF_TEST_FRAMEWORK_ENABLE_TEST=ON -DEMDEVIF_TEST_FRAMEWORK_TEST_NAME="integration_test"
18-
- name: make
19-
run: cmake --build build
14+
15+
- name: Setup deps
16+
run: sudo apt upgrade && sudo apt install build-essential cmake xmake clang-format
17+
18+
- name: clang-format check
19+
run: clang-format --dry-run $(git ls-files '*.c' '*.cpp' '*.h' '*.hpp')
20+
21+
- name: CMake config
22+
run: mkdir build && cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DEMDEVIF_TEST_FRAMEWORK_ENABLE_TEST=ON -DEMDEVIF_TEST_FRAMEWORK_TEST_NAME="integration_test" --verbose
23+
- name: CMake build
24+
run: cmake --build build --verbose
2025
- name: ctest
2126
run: cd build && ctest .
27+
28+
- name: clean
29+
run: rm -r build
30+
31+
- name: XMake config
32+
run: xmake f --EMDEVIF_TEST_FRAMEWORK_ENABLE_TEST=true --EMDEVIF_TEST_FRAMEWORK_TEST_NAME="integration_test" --verbose
33+
- name: XMake build
34+
run: xmake --build --verbose emdevif_test_framework_test
35+
- name: XMake run test
36+
run: xmake run emdevif_test_framework_test

0 commit comments

Comments
 (0)