-
Notifications
You must be signed in to change notification settings - Fork 25
75 lines (59 loc) · 1.95 KB
/
windows.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Windows
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure and build without format dependencies
shell: bash
run: |
cmake -Htest -Bbuild
cmake --build build
./build/Debug/test.exe
! cmake --build build --target format
- name: Install format dependencies
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
choco install llvm -y
echo "::add-path::C:\\Program Files\\LLVM\\bin"
pip3 install cmake_format==0.6.11 pyyaml
- name: Configure
shell: bash
run: cmake -Htest -Bbuild
- name: Run format
shell: bash
run: "cmake --build build --target format"
- name: Check clang-format
shell: bash
run: "! cmake --build build --target check-clang-format"
- name: Check cmake-format
shell: bash
run: "! cmake --build build --target check-cmake-format"
- name: Check format
shell: bash
run: "! cmake --build build --target check-format"
- name: Fix format
shell: bash
run: cmake --build build --target fix-format
- name: Check fixed format
shell: bash
run: cmake --build build --target check-format && ! git diff --exit-code
- name: Configure cmake-format with excluded file
# Not using `bash` to prevent regular expression from being treated as a filesystem path
run: |
git reset --hard HEAD
cmake -Htest -Bbuild -DCMAKE_FORMAT_EXCLUDE="(^|/)sample\.cmake$"
- name: Fix cmake-format skipping excluded file
shell: bash
run: cmake --build build --target fix-cmake-format
- name: Check cmake-format with excluded file
shell: bash
run: cmake --build build --target check-cmake-format && ! git diff --exit-code -- test/CMakeLists.txt && git diff --exit-code -- test/sample.cmake