-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (128 loc) · 4.41 KB
/
Copy pathci.yml
File metadata and controls
148 lines (128 loc) · 4.41 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
clang-format:
name: 'clang-format'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run clang-format
run: |
find LEGORacers GolDP common util miniwin 3rdparty/ffmpeg-indeo5/indeo5dec.c 3rdparty/ffmpeg-indeo5/indeo5dec.h \
-iname '*.h' -o -iname '*.cpp' | \
grep -v '3rdparty/ffmpeg-indeo5/shim' | xargs \
pipx run "clang-format>=22,<23" \
--style=file \
-i
- name: Check diff
run: |
git diff --exit-code
ncc:
name: Naming conventions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: '21'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install python libraries
run: |
pip install clang==21.* pyyaml
- name: Run ncc
run: |
python3 tools/ncc/ncc.py \
--clang-lib ${{ env.LLVM_PATH }}/lib/libclang.so \
--recurse \
--style tools/ncc/ncc.style \
--skip tools/ncc/skip.yml \
--definition DEFINE_GUID PASCAL WINAPI FAR BOOL CALLBACK HWND__=HWND SDLCALL GOLDP_EXPORT_INNER= \
--include \
util \
LEGORacers/include \
LEGORacers \
GolDP/include \
GolDP \
common/include \
common \
--exclude \
LEGORacers/src/app/main.cpp \
LEGORacers/emscripten/filesystem.cpp \
LEGORacers/emscripten/filesystem.h \
LEGORacers/src/video/avireader.cpp \
LEGORacers/src/video/videoplayer.cpp \
LEGORacers/include/video/avireader.h \
--path LEGORacers GolDP common
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: sh
strategy:
fail-fast: false
matrix:
include:
- { name: 'Linux', os: 'ubuntu-latest', generator: 'Ninja' , linux: true }
- { name: 'MSVC (x64)', os: 'windows-latest', generator: 'Ninja' , msvc: true, vc-arch: 'amd64' }
- { name: 'macOS', os: 'macos-latest', generator: 'Ninja' , brew: true }
- { name: 'Emscripten', os: 'ubuntu-latest', generator: 'Ninja' , emsdk: true, cmake-wrapper: 'emcmake' }
steps:
- name: Setup vcvars
if: ${{ !!matrix.msvc }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.vc-arch }}
- name: Setup ninja
if: ${{ !!matrix.msvc }}
uses: ashutoshvarma/setup-ninja@master
- name: Install Linux dependencies (apt-get)
if: ${{ matrix.linux }}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build \
libx11-dev libxext-dev libxrandr-dev libxrender-dev libxfixes-dev libxi-dev libxinerama-dev \
libxcursor-dev libwayland-dev libxkbcommon-dev wayland-protocols libgl1-mesa-dev \
libasound2-dev libpulse-dev libxss-dev libxtst-dev
- name: Install macOS dependencies (brew)
if: ${{ matrix.brew }}
run: |
brew update
brew install cmake ninja || true
- name: Install Emscripten dependencies (apt-get)
if: ${{ matrix.emsdk }}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Setup Emscripten
if: ${{ matrix.emsdk }}
uses: emscripten-core/setup-emsdk@v15
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure (CMake)
run: |
${{ matrix.cmake-wrapper || '' }} cmake -S . -B build -G "${{ matrix.generator }}" \
-DCMAKE_BUILD_TYPE=Release \
-DDOWNLOAD_DEPENDENCIES=ON \
-Werror=dev
- name: Build (CMake)
run: cmake --build build --config Release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: legoracers-${{ matrix.name }}
path: |
build/LEGORacers*
!build/LEGORacers*.dir