-
-
Notifications
You must be signed in to change notification settings - Fork 124
156 lines (122 loc) · 4.77 KB
/
ci.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
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
149
150
151
152
153
154
155
156
name: CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: environment-${{github.ref}}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows VS2019 x86, os: windows-2019, flags: -AWin32 }
- { name: Windows VS2019 x64, os: windows-2019, flags: -Ax64 }
- { name: Windows VS2022 x86, os: windows-2022, flags: -AWin32 }
- { name: Windows VS2022 x64, os: windows-2022, flags: -Ax64 }
- { name: Windows ClangCL, os: windows-2022, flags: -T ClangCL }
- { name: Windows Clang, os: windows-2022, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja }
- { name: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: MacOS, os: macos-14, flags: -GNinja }
config:
- { name: Shared, flags: -DBUILD_SHARED_LIBS=ON, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=OFF }
- { name: Static, flags: -DBUILD_SHARED_LIBS=OFF, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=ON }
type:
- { name: Debug }
- { name: Release }
steps:
- name: Get CMake and Ninja
uses: lukka/get-cmake@latest
with:
ninjaVersion: latest
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Checkout SFML
uses: actions/checkout@v4
with:
repository: SFML/SFML
ref: master
path: SFML
- name: Configure SFML CMake
run: cmake -S SFML -B SFML/build -DCMAKE_INSTALL_PREFIX=SFML/install ${{matrix.platform.flags}} ${{matrix.config.flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}}
- name: Build SFML
run: cmake --build SFML/build --config ${{matrix.type.name}} --target install
- name: Checkout CSFML
uses: actions/checkout@v4
with:
path: CSFML
- name: Configure CSFML CMake
run: cmake --preset dev -S CSFML -B CSFML/build -DCMAKE_INSTALL_PREFIX=CSFML/install -DSFML_ROOT=SFML/install -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.config.csfml_flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}}
- name: Build CSFML
run: cmake --build CSFML/build --config ${{matrix.type.name}} --target install
- name: Test
run: ctest --test-dir CSFML/build -C ${{matrix.type.name}} --output-on-failure
format:
name: Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Format Code
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-14 -P cmake/Format.cmake
- name: Check Formatting
run: git diff --exit-code
tidy:
name: Analyze
runs-on: macos-14
steps:
- name: Install Dependencies
run: |
brew update
brew install llvm ninja
echo /opt/homebrew/opt/llvm/bin >> $GITHUB_PATH
- name: Checkout SFML
uses: actions/checkout@v4
with:
repository: SFML/SFML
ref: master
path: SFML
- name: Configure SFML CMake
run: cmake -S SFML -B SFML/build -GNinja -DCMAKE_INSTALL_PREFIX=SFML/install -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug
- name: Build SFML
run: cmake --build SFML/build --target install
- name: Checkout CSFML
uses: actions/checkout@v4
with:
path: CSFML
- name: Configure CSFML CMake
run: cmake --preset dev -S CSFML -B CSFML/build -DSFML_ROOT=SFML/install -DCMAKE_BUILD_TYPE=Debug
- name: Tidy
run: cmake --build CSFML/build --target tidy
docs:
name: Documentation
runs-on: macos-14
steps:
- name: Install Doxygen
run: |
brew update
brew install doxygen ninja || true
- name: Checkout SFML
uses: actions/checkout@v4
with:
repository: SFML/SFML
ref: master
path: SFML
- name: Configure SFML
run: cmake -S SFML -B SFML/build -GNinja -DCMAKE_INSTALL_PREFIX=SFML/install
- name: Build SFML
run: cmake --build SFML/build --target install
- name: Checkout CSFML
uses: actions/checkout@v4
with:
path: CSFML
- name: Configure CSFML
run: cmake -S CSFML -B CSFML/build -GNinja -DSFML_ROOT=SFML/install -DCSFML_BUILD_DOC=ON -DCSFML_LINK_SFML_STATICALLY=ON
- name: Build Doxygen Site
run: cmake --build CSFML/build --target doc