Skip to content

Commit 74c5e86

Browse files
Add additional CI via GitHub Actions.
1 parent 45134b1 commit 74c5e86

File tree

5 files changed

+237
-2
lines changed

5 files changed

+237
-2
lines changed

.github/workflows/ci.yml

+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build_autotools:
11+
name: Autotools / ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [macos-12, macos-14, ubuntu-22.04]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Autotools
22+
if: runner.os == 'macOS'
23+
run: brew upgrade && brew install autoconf automake libtool
24+
25+
- name: Generate Autotools
26+
run: ./autogen.sh
27+
28+
- name: Configure Autotools
29+
run: ./configure
30+
31+
- name: Build
32+
run: make
33+
34+
- name: Test
35+
run: make check
36+
37+
build_cmake_ios:
38+
name: CMake / iOS
39+
runs-on: macos-14
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Configure CMake
45+
run: |
46+
cmake \
47+
-B build \
48+
-GXcode \
49+
-DCMAKE_SYSTEM_NAME=iOS \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
52+
-DCGLM_STATIC=ON \
53+
-DCGLM_USE_TEST=ON
54+
55+
- name: Build
56+
run: cmake --build build
57+
58+
build_cmake_macos:
59+
name: CMake / ${{ matrix.os }}
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
os: [macos-12, macos-14]
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Install Ninja
70+
if: runner.os == 'macOS'
71+
run: brew upgrade && brew install ninja
72+
73+
- name: Configure CMake
74+
run: |
75+
cmake \
76+
-B build \
77+
-GNinja \
78+
-DCMAKE_BUILD_TYPE=Release \
79+
-DCGLM_STATIC=ON \
80+
-DCGLM_USE_TEST=ON
81+
82+
- name: Build
83+
run: cmake --build build
84+
85+
- name: Test
86+
working-directory: build
87+
run: ./tests
88+
89+
build_cmake_ubuntu:
90+
name: CMake / ${{ matrix.target.os }} / ${{ matrix.target.cc }}
91+
runs-on: ${{ matrix.target.os }}
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
target:
96+
- { os: ubuntu-20.04, cc: gcc-11 }
97+
- { os: ubuntu-22.04, cc: gcc-12 }
98+
- { os: ubuntu-22.04, cc: gcc-13 }
99+
- { os: ubuntu-20.04, cc: clang-12 }
100+
- { os: ubuntu-22.04, cc: clang-15 }
101+
steps:
102+
- uses: actions/checkout@v4
103+
104+
- name: Install Compiler and Ninja
105+
run: |
106+
sudo apt-get update -y
107+
sudo apt-get install -y ${{ matrix.target.cc }} ninja-build
108+
109+
- name: Configure CMake
110+
run: |
111+
cmake \
112+
-B build \
113+
-GNinja \
114+
-DCMAKE_C_COMPILER=${{ matrix.target.cc }} \
115+
-DCMAKE_BUILD_TYPE=Release \
116+
-DCGLM_STATIC=ON \
117+
-DCGLM_USE_TEST=ON
118+
119+
- name: Build
120+
run: cmake --build build
121+
122+
- name: Test
123+
working-directory: build
124+
run: ./tests
125+
126+
build_cmake_windows:
127+
name: CMake / ${{ matrix.platform.name }}
128+
runs-on: windows-2022
129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
platform:
133+
- { name: Windows (x64), flags: -A x64 }
134+
- { name: Windows (x86), flags: -A Win32 }
135+
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
136+
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
137+
- { name: Windows (ARM), flags: -A ARM, skip_tests: true, skip_build: true } # This fails to build.
138+
- { name: Windows (ARM64), flags: -A ARM64, skip_tests: true }
139+
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", skip_tests: true }
140+
141+
steps:
142+
- uses: actions/checkout@v4
143+
144+
- name: Configure CMake
145+
run: cmake -B build `
146+
-DCGLM_STATIC=ON `
147+
-DCGLM_USE_TEST=ON `
148+
${{ matrix.platform.flags }}
149+
150+
- name: Build
151+
if: ${{ !matrix.platform.skip_build }}
152+
run: cmake --build build --config Release --parallel
153+
154+
- name: Test
155+
if: ${{ !matrix.platform.skip_tests }}
156+
working-directory: build
157+
run: .\Release\tests.exe
158+
159+
build_documentation:
160+
name: Documentation
161+
runs-on: ubuntu-22.04
162+
163+
steps:
164+
- uses: actions/checkout@v4
165+
166+
- uses: actions/setup-python@v5
167+
with:
168+
python-version: '3.12'
169+
170+
- name: Install Dependencies
171+
working-directory: docs
172+
run: python3 -m pip install -r requirements.txt
173+
174+
- name: Build
175+
working-directory: docs
176+
run: sphinx-build source build
177+
178+
build_meson:
179+
name: Meson / ${{ matrix.os }}
180+
runs-on: ${{ matrix.os }}
181+
strategy:
182+
fail-fast: false
183+
matrix:
184+
os: [macos-14, ubuntu-22.04]
185+
186+
steps:
187+
- uses: actions/checkout@v4
188+
189+
- uses: actions/setup-python@v5
190+
with:
191+
python-version: '3.12'
192+
cache: 'pip'
193+
194+
- name: Install meson
195+
run: python3 -m pip install meson ninja
196+
197+
- name: Build
198+
run: meson setup build -Dbuildtype=release --default-library=static -Dbuild_tests=true
199+
200+
- name: Test
201+
run: meson test -C build
202+
203+
build_msbuild:
204+
name: MSBuild / Windows
205+
runs-on: windows-2022
206+
207+
# This has no test yet.
208+
# It could also try building for ARM, ARM64, ARM64EC, but those fail currently.
209+
steps:
210+
- uses: actions/checkout@v4
211+
212+
- uses: microsoft/setup-msbuild@v2
213+
214+
- name: Build (x86)
215+
working-directory: win
216+
run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x86 /p:BuildInParallel=true
217+
218+
- name: Build (x64)
219+
working-directory: win
220+
run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x64 /p:BuildInParallel=true
221+
222+
build_swift:
223+
name: Swift ${{ matrix.swift }} / ${{ matrix.os }}
224+
runs-on: ${{ matrix.os }}
225+
strategy:
226+
fail-fast: false
227+
matrix:
228+
os: [macos-12, macos-14, ubuntu-22.04]
229+
230+
# This has no test yet.
231+
steps:
232+
- uses: actions/checkout@v4
233+
234+
- name: Build
235+
run: swift build

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</p>
66
<br>
77
<p align="center">
8-
<a href="https://travis-ci.com/recp/cglm">
9-
<img src="https://travis-ci.com/recp/cglm.svg?branch=master"
8+
<a href="https://github.com/recp/cglm/actions/workflows/ci.yml">
9+
<img src="https://github.com/recp/cglm/actions/workflows/ci.yml/badge.svg"
1010
alt="Build Status">
1111
</a>
1212
<a href="https://ci.appveyor.com/project/recp/cglm/branch/master">

autogen.sh

100644100755
File mode changed.

docs/make.bat

100644100755
File mode changed.

win/build.bat

100644100755
File mode changed.

0 commit comments

Comments
 (0)