Skip to content

Commit 6186120

Browse files
committed
LWJGL CI configuration
1 parent 81034ce commit 6186120

7 files changed

Lines changed: 307 additions & 501 deletions

File tree

.appveyor.yml

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

0 commit comments

Comments
 (0)