From a0b83bb62b836d11c61845afca757665cae9781a Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Thu, 24 Sep 2020 21:09:54 +0300 Subject: [PATCH] CI configuration --- .github/workflows/CI.yml | 244 +++++++++++++++++++++++++++++++++ .github/workflows/javadoc.yml | 63 +++++++++ .github/workflows/snapshot.yml | 104 ++++++++++++++ build.xml | 5 +- 4 files changed, 412 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/javadoc.yml create mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000000..51779e2156 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,244 @@ +# 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: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - 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: Download JDK + - run: ant -emacs hydrate-kotlinc + id: hydration + name: Check generator hydration + continue-on-error: true + - run: | + git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK + ant -emacs cache-kotlinc -Drevision="HEAD~2..HEAD~1" + if: steps.hydration.outcome == 'failure' + name: Cache kotlinc output + + 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 + PACKAGES: libX11-devel libXt-devel gtk3-devel libdbus-1-dev + steps: + - run: | + yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum -y install git + name: Upgrade git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - run: | + yum -y install epel-release + yum -y update + name: Configure yum + - run: | + yum -y install centos-release-scl + yum -y install devtoolset-11-gcc-c++ + yum -y install ant awscli + name: Install build dependencies + - run: | + yum -y install ${{matrix.PACKAGES}} + 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: Install LWJGL dependencies + - run: | + git config --global --add safe.directory $PWD + ant -emacs hydrate-kotlinc clean-generated generate + name: Hydrate generator + - run: ant -emacs compile + name: Build Java + - run: | + source scl_source enable devtoolset-11 || true + ant -emacs compile-native + name: Build native + - run: | + source scl_source enable devtoolset-11 || true + ant -emacs tests + name: Run tests + - run: | + source scl_source enable devtoolset-11 || true + ant -emacs upload-native + name: Upload artifacts + + linux-cross: + name: Linux Cross + needs: check-kotlinc-cache + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 + strategy: + fail-fast: false + matrix: + ARCH: [arm32, arm64] + include: + - ARCH: arm32 + PACKAGES: gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross + CROSS_ARCH: armhf + CROSS_PACKAGES: libgtk-3-dev:armhf libatk-bridge2.0-dev:armhf libgdk-pixbuf2.0-dev:armhf libglu-dev:armhf libgl1-mesa-glx:armhf libx11-dev:armhf libxt-dev:armhf libdbus-1-dev:armhf + NATIVE_PARAMS: -Dgcc.libpath.opengl=/usr/lib/arm-linux-gnueabihf/mesa + - ARCH: arm64 + PACKAGES: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross + CROSS_ARCH: arm64 + CROSS_PACKAGES: libgtk-3-dev:arm64 libatk-bridge2.0-dev:arm64 libgdk-pixbuf2.0-dev:arm64 libglu-dev:arm64 libgl1-mesa-glx:arm64 libx11-dev:arm64 libxt-dev:arm64 libdbus-1-dev:arm64 + NATIVE_PARAMS: -Dgcc.libpath.opengl=/usr/lib/aarch64-linux-gnu/mesa + env: + LWJGL_BUILD_ARCH: ${{matrix.ARCH}} + steps: + - 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 + apt-get -y update + apt-get install -y git + name: Upgrade git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - run: | + DEBIAN_FRONTEND=noninteractive apt-get -yq install ant awscli curl ${{matrix.PACKAGES}} + 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: Install dependencies + - 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/armhf,arm64/' /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: Prepare cross-compilation + - run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install ${{matrix.CROSS_PACKAGES}} -o Dpkg::Options::="--force-overwrite" + name: Install cross-compilation dependencies + - run: | + git config --global --add safe.directory $(pwd) + ant -emacs hydrate-kotlinc clean-generated generate + name: Hydrate generator + - run: ant -emacs compile + name: Build Java + - run: ant -emacs compile-native ${{matrix.NATIVE_PARAMS}} + name: Build native + - run: ant -emacs upload-native + name: Upload artifacts + + 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: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - 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: Install dependencies + - run: ant -emacs hydrate-kotlinc clean-generated generate + name: Hydrate generator + - run: ant -emacs compile + name: Build Java + - run: ant -emacs compile-native + name: Build native + - run: ant -emacs tests + name: Run tests + if: contains(matrix.ARCH, 'arm') != true + - run: ant -emacs upload-native + name: Upload artifacts + + 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}} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.MSVC_ARCH }} + - run: git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK + name: Clone Oculus SDK + if: contains(matrix.ARCH, 'arm') != true + - run: | + Invoke-WebRequest https://cdn.azul.com/zulu/bin/${{matrix.JDK}}.zip -OutFile jdk.zip + Expand-Archive -Path jdk.zip -DestinationPath .\ + name: Install dependencies + - run: ant -emacs hydrate-kotlinc clean-generated generate + shell: cmd + name: Generate bindings + - run: ant -emacs compile + shell: cmd + name: Build Java + - run: ant -emacs compile-native + shell: cmd + name: Build native + - run: ant -emacs tests + shell: cmd + if: contains(matrix.ARCH, 'arm') != true + name: Run tests + - run: type bin\test\testng-results.xml + shell: cmd + if: failure() + name: Print test results + - run: ant -emacs upload-native + shell: cmd + name: Upload artifacts \ No newline at end of file diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml new file mode 100644 index 0000000000..5ae8bc992b --- /dev/null +++ b/.github/workflows/javadoc.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000000..249a3f832c --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,104 @@ +# Produces a new build, uploads it to S3 and publishes a Maven snapshot +name: LWJGL Snapshot + +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" + #ANT_OPTS: -Xmx2G + ANT_OPTS: -Xmx8G + LWJGL_BUILD_TYPE: nightly + +#jobs: +# linux: +# name: Snapshot +# runs-on: ubuntu-18.04 +# steps: +# - uses: actions/checkout@v3 +# with: +# fetch-depth: 3 +# - uses: gradle/wrapper-validation-action@v1 +# - run: | +# aws s3 cp s3://lwjgl-build/ci/next-build.txt . +# LWJGL_BUILD=$(cat next-build.txt) +# echo "LWJGL_BUILD=$LWJGL_BUILD" >> $GITHUB_ENV +# name: Retrieve build number +# - 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: | +# export JAVA_HOME=$(pwd)/jdk19 +# JAVA8_HOME=$(pwd)/jdk8 ANT_OPTS="$ANT_OPTS -Djava.security.manager=allow" ant -emacs release -Dbuild.revision=${{env.LWJGL_BUILD}} +# $JAVA_HOME/bin/jar cfM lwjgl.zip -C bin/RELEASE . +# name: "Package snapshot #${{env.LWJGL_BUILD}}" +# - run: | +# aws s3 cp lwjgl.zip s3://lwjgl-build/nightly/lwjgl.zip $S3_PARAMS +# aws s3 sync bin/RELEASE s3://lwjgl-build/nightly/bin --delete $S3_PARAMS +# name: Upload snapshot to S3 +# - run: | +# export JAVA_HOME=$(pwd)/jdk8 +# ./gradlew -Psnapshot -PsonatypeUsername=${{ secrets.SONATYPE_USER }} -PsonatypePassword=${{ secrets.SONATYPE_PWD }} publish +# name: Publish snapshot to Maven +# - run: | +# echo -n $((LWJGL_BUILD+1)) > next-build.txt +# echo "Next build will be #$(cat next-build.txt)" +# aws s3 cp next-build.txt s3://lwjgl-build/ci/ +# name: Bump build number + +jobs: + macos: + name: Snapshot + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - uses: gradle/wrapper-validation-action@v1 + - run: | + aws s3 cp s3://lwjgl-build/ci/next-build.txt . + LWJGL_BUILD=$(cat next-build.txt) + echo "LWJGL_BUILD=$LWJGL_BUILD" >> $GITHUB_ENV + name: Retrieve build number + - 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: | + export JAVA_HOME=$(pwd)/jdk20 + JAVA8_HOME=$(pwd)/jdk8 ANT_OPTS="$ANT_OPTS -Djava.security.manager=allow" ant -emacs release -Dbuild.revision=${{env.LWJGL_BUILD}} + $JAVA_HOME/bin/jar cfM lwjgl.zip -C bin/RELEASE . + name: "Package snapshot #${{env.LWJGL_BUILD}}" + - run: | + aws s3 cp lwjgl.zip s3://lwjgl-build/nightly/lwjgl.zip $S3_PARAMS + aws s3 sync bin/RELEASE s3://lwjgl-build/nightly/bin --delete $S3_PARAMS + name: Upload snapshot to S3 + - run: | + export JAVA_HOME=$(pwd)/jdk8 + ./gradlew -Psnapshot -PsonatypeUsername=${{ secrets.SONATYPE_USER }} -PsonatypePassword=${{ secrets.SONATYPE_PWD }} publish + name: Publish snapshot to Maven + - run: | + echo -n $((LWJGL_BUILD+1)) > next-build.txt + echo "Next build will be #$(cat next-build.txt)" + aws s3 cp next-build.txt s3://lwjgl-build/ci/ + name: Bump build number diff --git a/build.xml b/build.xml index d0fad8224f..08161604bf 100644 --- a/build.xml +++ b/build.xml @@ -1365,6 +1365,7 @@ notree="true" public="true" failonerror="true" + verbose="true" unless:set="javadoc.skip" > LWJGL - @{title}]]> @@ -1499,8 +1500,6 @@ - - @@ -1872,7 +1871,5 @@ - -