-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (67 loc) · 2.03 KB
/
build.yml
File metadata and controls
78 lines (67 loc) · 2.03 KB
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
76
77
78
name: Build
on:
push:
branches:
- 'main'
pull_request:
jobs:
build:
name: Build
runs-on: windows-2019
concurrency:
group: flow-sdk-build-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout Code and Submodules
uses: actions/checkout@v2
with:
submodules: recursive
# Environment - needs MSVC
- name: Set up Visual Studio Shell
uses: egor-tensin/vs-shell@v2
with:
arch: x86
- name: Check Clang Version
run: clang-cl --version
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Run CMake
env:
CC: clang-cl
CFLAGS: -m32
CXX: clang-cl
CXXFLAGS: -m32
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_DEPENDS_USE_COMPILER=FALSE -G Ninja -Bbuild
# Run the build and tests
- name: Run Ninja Build
working-directory: build
run: ninja
- name: Run Tests
working-directory: build
run: ctest -C Release --output-on-failure --no-tests=error
format:
name: Format
runs-on: windows-latest
concurrency:
group: flow-sdk-format-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
# Environment things
- name: Check Clang Version
run: clang-cl --version
- name: Get All Changed Files
id: changed-files
uses: Ana06/get-changed-files@v2.0.0
with:
filter: |
src/**/*.cpp
src/**/*.h
test/**/*.cpp
test/**/*.h
- name: Clang Format
run: |
if (-not ([string]::IsNullOrEmpty("${{ steps.changed-files.outputs.added_modified }}"))) { clang-format --style=file --dry-run -Werror ${{ steps.changed-files.outputs.added_modified }} }