Skip to content

Commit 5c427c7

Browse files
committed
LWJGL CI configuration
1 parent 1972241 commit 5c427c7

File tree

7 files changed

+312
-519
lines changed

7 files changed

+312
-519
lines changed

.appveyor.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* text=auto eol=lf
1+
* -text

.github/workflows/check_formatting.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/lwjgl.yml

Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
name: LWJGL Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
AWS_DEFAULT_REGION: us-east-1
11+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
12+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
13+
S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0"
14+
JEMALLOC_PARAMS: --with-jemalloc-prefix=je_ --disable-stats --disable-fill --disable-cxx --enable-doc=no
15+
16+
jobs:
17+
linux:
18+
name: Linux
19+
runs-on: ubuntu-latest
20+
container:
21+
image: almalinux:8
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
ARCH: [ x64 ]
26+
include:
27+
- ARCH: x64
28+
HOST: x86_64-pc-linux-gnu
29+
defaults:
30+
run:
31+
shell: bash
32+
steps:
33+
- name: Install git
34+
run: dnf -y install git
35+
- name: Clone repository
36+
run: git clone --depth 3 https://github.com/${{ github.repository }}.git .
37+
- name: Install build dependencies
38+
run: |
39+
dnf -y install epel-release wget
40+
wget https://pkgs.sysadmins.ws/el8/base/x86_64/raven-release-1.0.1-1.el8.noarch.rpm
41+
rpm -ivh raven-release-1.0.1-1.el8.noarch.rpm
42+
dnf config-manager --set-enabled powertools
43+
dnf config-manager --set-enabled raven-extras
44+
dnf -y update
45+
dnf -y install gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ autoconf automake libtool awscli
46+
- name: Configure build
47+
run: |
48+
source /opt/rh/gcc-toolset-15/enable || true
49+
CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" ./autogen.sh \
50+
$JEMALLOC_PARAMS \
51+
--disable-initial-exec-tls \
52+
--host=${{matrix.HOST}} || (cat config.log ; exit 1)
53+
- name: Build
54+
run: |
55+
source /opt/rh/gcc-toolset-15/enable || true
56+
make -j8
57+
strip lib/libjemalloc.so
58+
- name: Upload artifact
59+
run: aws s3 cp lib/libjemalloc.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
60+
- name: Upload git revision
61+
run: |
62+
git config --global --add safe.directory $PWD
63+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libjemalloc.so.git
64+
aws s3 cp libjemalloc.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
65+
66+
linux-cross:
67+
name: Linux Cross
68+
runs-on: ubuntu-22.04
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
ARCH: [arm32, arm64, ppc64le, riscv64]
73+
include:
74+
# -----
75+
- ARCH: arm32
76+
CROSS_ARCH: armhf
77+
TRIPLET: arm-linux-gnueabihf
78+
EXTRA_PARAMS:
79+
HOST: arm-unknown-linux-gnueabihf
80+
# -----
81+
- ARCH: arm64
82+
CROSS_ARCH: arm64
83+
TRIPLET: aarch64-linux-gnu
84+
EXTRA_PARAMS: --with-lg-page=16
85+
HOST: aarch64-unknown-linux-gnu
86+
# ----
87+
- ARCH: ppc64le
88+
CROSS_ARCH: ppc64el
89+
TRIPLET: powerpc64le-linux-gnu
90+
EXTRA_PARAMS: --with-lg-page=16
91+
HOST: powerpc64le-unknown-linux-gnu
92+
# -----
93+
- ARCH: riscv64
94+
CROSS_ARCH: riscv64
95+
TRIPLET: riscv64-linux-gnu
96+
EXTRA_PARAMS:
97+
HOST: riscv64-unknown-linux-gnu
98+
env:
99+
LWJGL_ARCH: ${{matrix.ARCH}}
100+
defaults:
101+
run:
102+
shell: bash
103+
steps:
104+
- uses: actions/checkout@v6
105+
with:
106+
fetch-depth: 3
107+
fetch-tags: true
108+
- name: Install dependencies
109+
run: |
110+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update
111+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install awscli autoconf make \
112+
gcc-12-${{matrix.TRIPLET}} \
113+
libc6-dev-${{matrix.CROSS_ARCH}}-cross
114+
- name: Configure build
115+
run: |
116+
export PKG_CONFIG_LIBDIR="/usr/lib/${{matrix.TRIPLET}}/pkgconfig:/usr/share/pkgconfig"
117+
CC=${{matrix.TRIPLET}}-gcc-12 CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" ./autogen.sh \
118+
$JEMALLOC_PARAMS \
119+
${{matrix.EXTRA_PARAMS}} \
120+
--disable-initial-exec-tls \
121+
--host=${{matrix.HOST}} || (cat config.log ; exit 1)
122+
- name: Build
123+
run: |
124+
make -j8
125+
${{matrix.TRIPLET}}-strip lib/libjemalloc.so
126+
- name: Upload artifact
127+
run: aws s3 cp lib/libjemalloc.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
128+
- name: Upload git revision
129+
run: |
130+
git config --global --add safe.directory $PWD
131+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libjemalloc.so.git
132+
aws s3 cp libjemalloc.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
133+
134+
freebsd-cross:
135+
name: FreeBSD Cross
136+
runs-on: ubuntu-latest
137+
strategy:
138+
fail-fast: false
139+
steps:
140+
- uses: actions/checkout@v6
141+
with:
142+
fetch-depth: 3
143+
fetch-tags: true
144+
- name: Build
145+
uses: cross-platform-actions/[email protected]
146+
with:
147+
operating_system: freebsd
148+
architecture: x86-64
149+
version: '13.5'
150+
memory: 4G
151+
shell: bash
152+
environment_variables: JEMALLOC_PARAMS
153+
run: |
154+
sudo pkg install -y autoconf automake libtool gmake
155+
CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" ./autogen.sh $JEMALLOC_PARAMS --disable-initial-exec-tls --enable-lazy-lock=no
156+
gmake -j2
157+
strip lib/libjemalloc.so
158+
- name: Upload artifact
159+
run: aws s3 cp lib/libjemalloc.so s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}}
160+
- name: Upload git revision
161+
run: |
162+
git config --global --add safe.directory $PWD
163+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libjemalloc.so.git
164+
aws s3 cp libjemalloc.so.git s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}}
165+
166+
macos:
167+
name: macOS
168+
runs-on: macos-latest
169+
strategy:
170+
fail-fast: false
171+
matrix:
172+
ARCH: [x64, arm64]
173+
include:
174+
- ARCH: x64
175+
DARWIN: 15
176+
CC: MACOSX_DEPLOYMENT_TARGET=10.11 EXTRA_CFLAGS="-target x64-apple-darwin -arch x86_64 -mmacosx-version-min=10.11" LDFLAGS="-target x64-apple-darwin -arch x86_64 -mmacosx-version-min=10.11"
177+
HOST: x86_64
178+
EXTRA_PARAMS:
179+
- ARCH: arm64
180+
DARWIN: 20
181+
CC: MACOSX_DEPLOYMENT_TARGET=11.0 EXTRA_CFLAGS="-target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0" LDFLAGS="-target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0"
182+
HOST: aarch64
183+
EXTRA_PARAMS: --with-lg-page=14
184+
steps:
185+
- uses: actions/checkout@v6
186+
with:
187+
fetch-depth: 3
188+
fetch-tags: true
189+
- name: Install dependencies
190+
run: brew install automake
191+
- name: Configure build
192+
run: |
193+
${{matrix.CC}} ./autogen.sh \
194+
$JEMALLOC_PARAMS \
195+
--disable-initial-exec-tls \
196+
--disable-zone-allocator \
197+
--target ${{matrix.ARCH}}-apple-darwin${{matrix.DARWIN}} \
198+
--host=${{matrix.HOST}}-apple-darwin${{matrix.DARWIN}} \
199+
${{matrix.EXTRA_PARAMS}}
200+
- name: Build
201+
run: |
202+
${{matrix.CC}} make -j8
203+
strip -u -r lib/libjemalloc.dylib
204+
- name: Upload artifact
205+
run: aws s3 cp lib/libjemalloc.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
206+
- name: Upload git revision
207+
run: |
208+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libjemalloc.dylib.git
209+
aws s3 cp libjemalloc.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
210+
211+
windows:
212+
name: Windows
213+
runs-on: windows-latest
214+
strategy:
215+
fail-fast: false
216+
matrix:
217+
ARCH: [x86, x64, arm64]
218+
include:
219+
- ARCH: x86
220+
#MSVC_ARCH: amd64_x86
221+
MSVC_ARCH: x86
222+
HOST: i686-pc-cygwin
223+
CFLAGS:
224+
VCTOOLS: x86.x64
225+
- ARCH: x64
226+
MSVC_ARCH: amd64
227+
HOST: x86_64-w64-cygwin
228+
CFLAGS:
229+
VCTOOLS: x86.x64
230+
- ARCH: arm64
231+
#MSVC_ARCH: amd64_arm64
232+
MSVC_ARCH: arm64
233+
HOST: aarch64-w64-cygwin
234+
CFLAGS: /D__aarch64__
235+
VCTOOLS: ARM64
236+
defaults:
237+
run:
238+
shell: cmd
239+
steps:
240+
- uses: actions/checkout@v6
241+
with:
242+
fetch-depth: 3
243+
fetch-tags: true
244+
# - id: cygwin-cache
245+
# uses: actions/cache@v4
246+
# with:
247+
# path: C:\cygwin
248+
# key: cygwin-cache
249+
# - uses: ilammy/msvc-dev-cmd@v1
250+
# with:
251+
# arch: ${{matrix.MSVC_ARCH}}
252+
- name: Install dependencies
253+
run: |
254+
choco install cygwin -x64 --params "/InstallDir:C:\cygwin"
255+
choco install cyg-get
256+
cyg-get autoconf make
257+
#if: steps.cygwin-cache.outputs.cache-hit != 'true'
258+
# - name: Prepare Cygwin
259+
# run: C:\cygwin\bin\sh -lc "(cd $OLDPWD;)"
260+
- name: Install Visual Studio 2026 Build Tools
261+
shell: pwsh
262+
run: |
263+
choco install visualstudio2026buildtools --package-parameters "`
264+
--add Microsoft.VisualStudio.Workload.VCTools `
265+
--add Microsoft.VisualStudio.Component.VC.Tools.${{matrix.VCTOOLS}} `
266+
--includeRecommended `
267+
--quiet" `
268+
-y `
269+
--ignore-package-exit-codes=3010
270+
- name: Prepare build script
271+
run: |
272+
cat > build.sh <<'EOF'
273+
echo Building with JEMALLOC_PARAMS: $JEMALLOC_PARAMS
274+
cd $(cygpath $RUNNER_WORKSPACE)/jemalloc
275+
autoconf
276+
CFLAGS='/EHsc /GF /Gy /GL /GR- /GS- /MP /DNDEBUG ${{matrix.CFLAGS}}' CC=cl ac_cv_c_bigendian=no ./configure --host=${{matrix.HOST}} $JEMALLOC_PARAMS
277+
make
278+
EOF
279+
echo BUILD SCRIPT
280+
echo ------------
281+
cat build.sh
282+
chmod +x build.sh
283+
# - name: Configure build
284+
# run: |
285+
# C:\cygwin\bin\sh -lc "(cd $OLDPWD; set -o igncr; autoconf;)"
286+
# C:\cygwin\bin\sh -lc "(cd $OLDPWD; set -o igncr; CFLAGS='/EHsc /GF /Gy /GL /GR- /GS- /MP /DNDEBUG ${{matrix.CFLAGS}}' CC=cl ac_cv_c_bigendian=no ./configure --host=${{matrix.HOST}} %JEMALLOC_PARAMS%;)"
287+
# - name: Build
288+
# run: |
289+
# C:\cygwin\bin\sh -lc "(cd $OLDPWD; set -o igncr; make;)"
290+
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
291+
- name: Build
292+
run: |
293+
call "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=${{matrix.MSVC_ARCH}}
294+
cl.exe
295+
C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr build.sh
296+
- name: Upload artifact
297+
run: aws s3 cp lib\jemalloc.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
298+
- name: Upload git revision
299+
run: |
300+
git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > jemalloc.dll.git
301+
aws s3 cp jemalloc.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}

0 commit comments

Comments
 (0)