-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (73 loc) · 2.08 KB
/
analyze.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Code Analysis
on:
pull_request:
branches: [ main, dev ]
paths:
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.cmake'
- '**/CMakeLists.txt'
- '**/.clang-tidy'
- '**/.clang-format'
workflow_dispatch:
env:
home: /home/runner
jobs:
format:
name: Check formatting
runs-on: ubuntu-latest
container:
image: ghcr.io/limpingpebble/toolchain:llvm18-ninja1.12.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Run clang-format
run: find Engine examples -name '*.cpp' -or -name '*.h' -or -name '*.hpp' | xargs clang-format -i -style=file
- name: Check for differences
if: ${{ !env.ACT }}
run: |
git config --global --add safe.directory /__w/StoneEngine/StoneEngine
git diff --exit-code || (echo "Code is not formatted properly" && exit 1)
build:
name: Build project
runs-on: ubuntu-latest
container:
image: ghcr.io/limpingpebble/toolchain:llvm18-ninja1.12.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
uses: actions/checkout@v4
- name: Cache cmake output
uses: actions/cache@v4
with:
key: cmake-debug
path: build/debug
- name: Configure and build project
run: cmake --workflow --preset build-debug
test:
name: Run tests
runs-on: ubuntu-latest
needs: build
container:
image: ghcr.io/limpingpebble/toolchain:llvm18-ninja1.12.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
uses: actions/checkout@v4
- name: Cache cmake output
uses: actions/cache@v4
with:
key: cmake-debug
path: build/debug
- name: Run tests
run: cmake --workflow --preset pipeline-test