Skip to content

Commit

Permalink
CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Nov 9, 2023
1 parent 3df27bf commit 19d57b6
Show file tree
Hide file tree
Showing 5 changed files with 435 additions and 7 deletions.
264 changes: 264 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# TODO: https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/
name: LWJGL Build

on:
workflow_dispatch:
push:
branches:
- master

env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0"
JAVA_HOME: jdk8
ANT_OPTS: -Xmx2G
LWJGL_BUILD_TYPE: nightly

jobs:
check-kotlinc-cache:
name: Check kotlinc cache
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Download JDK
run: |
mkdir jdk8
curl https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Check generator hydration
run: ant -emacs hydrate-kotlinc
id: hydration
continue-on-error: true
- name: Cache kotlinc output
run: |
git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
ANT_OPTS=-Xmx4G ant -emacs cache-kotlinc -Drevision="HEAD~2..HEAD~1"
if: steps.hydration.outcome == 'failure'

linux:
name: Linux
needs: check-kotlinc-cache
runs-on: ubuntu-latest
container:
image: centos:7
strategy:
fail-fast: false
matrix:
ARCH: [x64]
include:
- ARCH: x64
defaults:
run:
shell: bash
steps:
- name: Upgrade git
run: |
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum -y install git
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Configure yum
run: |
yum -y install epel-release
yum -y update
- name: Install build dependencies
run: |
yum -y install centos-release-scl
yum -y install devtoolset-11-gcc-c++
yum -y install ant awscli
- name: Install LWJGL dependencies
run: |
yum -y install libX11-devel libXt-devel gtk3-devel libdbus-1-dev
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Hydrate generator
run: |
git config --global --add safe.directory $PWD
ant -emacs hydrate-kotlinc clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: |
source scl_source enable devtoolset-11 || true
ant -emacs compile-native
- name: Run tests
run: |
source scl_source enable devtoolset-11 || true
ant -emacs tests
- name: Upload artifacts
run: |
source scl_source enable devtoolset-11 || true
ant -emacs upload-native
linux-cross:
name: Linux Cross
needs: check-kotlinc-cache
runs-on: ubuntu-latest
container:
image: ${{matrix.CONTAINER}}
strategy:
fail-fast: false
matrix:
ARCH: [arm32, arm64, ppc64le, riscv64]
include:
# ----
- ARCH: arm32
CROSS_ARCH: armhf
CONTAINER: ubuntu:18.04
TRIPLET: arm-linux-gnueabihf
# ----
- ARCH: arm64
CROSS_ARCH: arm64
CONTAINER: ubuntu:18.04
TRIPLET: aarch64-linux-gnu
# ----
- ARCH: ppc64le
CROSS_ARCH: ppc64el
CONTAINER: ubuntu:18.04
TRIPLET: powerpc64le-linux-gnu
# ----
- ARCH: riscv64
CROSS_ARCH: riscv64
CONTAINER: ubuntu:20.04
TRIPLET: riscv64-linux-gnu
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
defaults:
run:
shell: bash
steps:
- name: Upgrade git
run: |
apt-get -y update
apt-get -y install software-properties-common
apt-get -y install --reinstall ca-certificates
apt-get -y update
apt-get -y upgrade
add-apt-repository -y ppa:git-core/ppa
if: ${{ matrix.CONTAINER == 'ubuntu:18.04' }}
- run: |
apt-get -y update
apt-get install -y git
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Install dependencies
run: |
git config --global --add safe.directory $(pwd)
DEBIAN_FRONTEND=noninteractive apt-get -yq install ant awscli curl gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Prepare cross-compilation for ${{matrix.CROSS_ARCH}}
run: |
sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
grep "ubuntu.com/ubuntu" /etc/apt/sources.list | tee /etc/apt/sources.list.d/ports.list
sed -i 's/amd64,i386/${{matrix.CROSS_ARCH}}/' /etc/apt/sources.list.d/ports.list
sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list
dpkg --add-architecture ${{matrix.CROSS_ARCH}}
apt-get clean
apt-get update || true
- name: Install cross-compilation dependencies
run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install libgtk-3-dev:${{matrix.CROSS_ARCH}} libatk-bridge2.0-dev:${{matrix.CROSS_ARCH}} libgdk-pixbuf2.0-dev:${{matrix.CROSS_ARCH}} libglu-dev:${{matrix.CROSS_ARCH}} libgl1-mesa-glx:${{matrix.CROSS_ARCH}} libx11-dev:${{matrix.CROSS_ARCH}} libxt-dev:${{matrix.CROSS_ARCH}} libdbus-1-dev:${{matrix.CROSS_ARCH}} -o Dpkg::Options::="--force-overwrite"
- name: Hydrate generator
run: ant -emacs hydrate-kotlinc clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: ant -emacs compile-native -Dgcc.libpath.opengl=/usr/lib/${{matrix.TRIPLET}}/mesa
- name: Upload artifacts
run: ant -emacs upload-native

macos:
name: macOS
needs: check-kotlinc-cache
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ARCH: [x64, arm64]
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Install dependencies
run: |
mkdir jdk8
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-fx-jdk8.0.382-macosx_x64.tar.gz | tar xz -C jdk8 --strip-components 1
- name: Hydrate generator
run: ant -emacs hydrate-kotlinc clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: ant -emacs compile-native
- name: Run tests
run: ant -emacs tests
if: matrix.ARCH == 'x64'
- name: Upload artifacts
run: ant -emacs upload-native

windows:
name: Windows
needs: check-kotlinc-cache
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ARCH: [x86, x64, arm64]
include:
- ARCH: x86
JDK: zulu8.72.0.17-ca-fx-jdk8.0.382-win_i686
MSVC_ARCH: amd64_x86
- ARCH: x64
JDK: zulu8.72.0.17-ca-fx-jdk8.0.382-win_x64
MSVC_ARCH: amd64
- ARCH: arm64
JDK: zulu8.72.0.17-ca-fx-jdk8.0.382-win_x64
MSVC_ARCH: amd64_arm64
env:
ANT_OPTS: -Xmx1G
JAVA_HOME: ${{matrix.JDK}}
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
defaults:
run:
shell: cmd
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.MSVC_ARCH }}
- name: Clone Oculus SDK
run: git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
if: contains(matrix.ARCH, 'arm') != true
- name: Install dependencies
run: |
Invoke-WebRequest https://cdn.azul.com/zulu/bin/${{matrix.JDK}}.zip -OutFile jdk.zip
Expand-Archive -Path jdk.zip -DestinationPath .\
shell: pwsh
- name: Generate bindings
run: ant -emacs hydrate-kotlinc clean-generated generate
- name: Build Java
run: ant -emacs compile
- name: Build native
run: ant -emacs compile-native
- name: Run tests
run: ant -emacs tests
if: contains(matrix.ARCH, 'arm') != true
- name: Print test results
run: type bin\test\testng-results.xml
if: failure()
- name: Upload artifacts
run: ant -emacs upload-native
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: LWJGL Build

on:
workflow_dispatch:
push:
branches:
- master
#push:
#branches:
#- master

env:
JAVA_HOME: jdk8
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generates javadoc for core + all bindings and uploads it to S3.
# The resulting javadoc is available at https://javadoc.lwjgl.org/
name: LWJGL Javadoc generation

on:
workflow_dispatch:

env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0"
LWJGL_BUILD_TYPE: nightly

#jobs:
# linux:
# name: Javadoc
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 3
# - run: |
# git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
# curl https://cdn.azul.com/zulu/bin/zulu8.64.0.19-ca-fx-jdk8.0.345-linux_x64.tar.gz --output jdk8.tar.gz
# curl https://cdn.azul.com/zulu/bin/zulu19.28.81-ca-jdk19.0.0-linux_x64.tar.gz --output jdk19.tar.gz
# mkdir jdk8
# mkdir jdk19
# tar xf jdk8.tar.gz -C jdk8 --strip-components 1
# tar xf jdk19.tar.gz -C jdk19 --strip-components 1
# name: Install dependencies
# - run: JAVA_HOME=$(pwd)/jdk8 ant -emacs hydrate-kotlinc clean-generated generate
# name: Generate bindings
# - run: JAVA_HOME=$(pwd)/jdk8 ant -emacs compile
# name: Build Java
# - run: JAVA8_HOME=$(pwd)/jdk8 JAVA_HOME=$(pwd)/jdk19 ANT_OPTS="$ANT_OPTS -XX:+UseShenandoahGC -Djava.security.manager=allow" ant -emacs javadoc
# name: Generate javadoc
# - run: aws s3 sync bin/javadoc s3://lwjgl-javadoc/ --delete
# name: Upload javadoc to S3

jobs:
macos:
name: Javadoc
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- run: |
git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
mkdir jdk8
mkdir jdk20
curl -L https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-jdk8.0.382-macosx_x64.tar.gz | tar xz -C jdk8 --strip-components 1
curl -L https://cdn.azul.com/zulu/bin/zulu20.32.11_1-ca-jdk20.0.2-macosx_x64.tar.gz | tar xz -C jdk20 --strip-components 1
name: Install dependencies
- run: JAVA_HOME=$(pwd)/jdk8 ant -emacs hydrate-kotlinc clean-generated generate
name: Generate bindings
- run: JAVA_HOME=$(pwd)/jdk8 ant -emacs compile
name: Build Java
- run: JAVA8_HOME=$(pwd)/jdk8 JAVA_HOME=$(pwd)/jdk20 ANT_OPTS="-Djava.security.manager=allow" ant -emacs javadoc
name: Generate javadoc
- run: aws s3 sync bin/javadoc s3://lwjgl-javadoc/ --delete
name: Upload javadoc to S3
Loading

0 comments on commit 19d57b6

Please sign in to comment.