From 234518eb8a00f3b97acb24a7f486e41c4dd5a724 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Sat, 12 Oct 2019 16:45:31 +0300 Subject: [PATCH] LWJGL CI configuration --- .gitattributes | 1 + .github/workflows/lwjgl.yml | 200 ++++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 83 --------------- XCompile-lwjgl.cmake | 2 + appveyor.yml | 33 ------ 5 files changed, 203 insertions(+), 116 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/lwjgl.yml delete mode 100644 .github/workflows/main.yml create mode 100644 XCompile-lwjgl.cmake delete mode 100644 appveyor.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..774506262 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml new file mode 100644 index 000000000..c294b77b5 --- /dev/null +++ b/.github/workflows/lwjgl.yml @@ -0,0 +1,200 @@ +name: LWJGL Build + +on: + push: + branches: + - main + +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" + CMAKE_BUILD_PARALLEL_LEVEL: 4 + SPVC_PARAMS: -DSPIRV_CROSS_STATIC=OFF -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_SKIP_INSTALL=ON -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_FORCE_PIC=ON + +jobs: + linux: + name: Linux + 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 + - 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 cmake3 awscli + - name: Configure build + run: | + source scl_source enable devtoolset-11 || true + cmake3 -B build ${{env.SPVC_PARAMS}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + - name: Build + run: | + source scl_source enable devtoolset-11 || true + cmake3 --build build --parallel + strip build/libspirv-cross-c-shared.so + - name: Upload artifact + run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/libspirv-cross.so $S3_PARAMS + - name: Upload git revision + run: | + git config --global --add safe.directory $PWD + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git + aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + + linux-cross: + name: Linux Cross + runs-on: ubuntu-latest + container: + image: ${{matrix.CONTAINER}} + strategy: + fail-fast: false + matrix: + ARCH: [arm32, arm64, mips64, ppc64le, riscv64] + include: + # ----- + - ARCH: arm32 + CROSS_ARCH: armhf + CONTAINER: ubuntu:18.04 + TRIPLET: arm-linux-gnueabihf + CMAKE_PARAMS: -DSYSTEM_PROCESSOR=arm + # ----- + - ARCH: arm64 + CROSS_ARCH: arm64 + CONTAINER: ubuntu:18.04 + TRIPLET: aarch64-linux-gnu + CMAKE_PARAMS: -DSYSTEM_PROCESSOR=aarch64 + # ----- + - ARCH: mips64 + CROSS_ARCH: mips64el + CONTAINER: ubuntu:18.04 + TRIPLET: mips64el-linux-gnuabi64 + CMAKE_PARAMS: -DSYSTEM_PROCESSOR=mips64 + # ---- + - ARCH: ppc64le + CROSS_ARCH: ppc64el + CONTAINER: ubuntu:18.04 + TRIPLET: powerpc64le-linux-gnu + CMAKE_PARAMS: -DPROCESSOR=powerpc64le + # ----- + - ARCH: riscv64 + CROSS_ARCH: riscv64 + CONTAINER: ubuntu:18.04 + TRIPLET: riscv64-linux-gnu + CMAKE_PARAMS: -DSYSTEM_PROCESSOR=riscv64 + defaults: + run: + shell: bash + steps: + - name: Upgrade git + run: | + apt-get -y update + apt-get -y install software-properties-common wget + apt-get -y install --reinstall ca-certificates + apt-get -y update + apt-get -y upgrade + wget https://apt.kitware.com/keys/kitware-archive-latest.asc + apt-key add kitware-archive-latest.asc + add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' + add-apt-repository -y ppa:git-core/ppa + apt-get -y update + DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Install dependencies + run: DEBIAN_FRONTEND=noninteractive apt-get -yq install cmake gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross + - name: Configure build + run: CC=${{matrix.TRIPLET}}-gcc CXX=${{matrix.TRIPLET}}-g++ cmake -B build ${{env.SPVC_PARAMS}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" -DCMAKE_TOOLCHAIN_FILE=../XCompile-lwjgl.cmake -DSYSTEM_NAME=Linux ${{matrix.CMAKE_PARAMS}} + - name: Build + run: | + cmake --build build --parallel + ${{matrix.TRIPLET}}-strip build/libspirv-cross-c-shared.so + - name: Upload artifact + run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/libspirv-cross.so $S3_PARAMS + - name: Upload git revision + run: | + git config --global --add safe.directory $(pwd) + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git + aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ $S3_PARAMS + + macos: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 + - ARCH: arm64 + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=../XCompile-lwjgl.cmake -DSYSTEM_NAME=Darwin -DSYSTEM_PROCESSOR=aarch64 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Configure build + run: cmake -B build ${{env.SPVC_PARAMS}} -DCMAKE_BUILD_TYPE=Release ${{matrix.CMAKE_PARAMS}} + - name: Build + run: | + cmake --build build --parallel + strip -u -r build/libspirv-cross-c-shared.dylib + - name: Upload artifact + run: aws s3 cp build/libspirv-cross-c-shared.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/libspirv-cross.dylib $S3_PARAMS + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.dylib.git + aws s3 cp libspirv-cross.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + + windows: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + ARCH: [x86, x64, arm64] + include: + - ARCH: x86 + PLATFORM: Win32 + - ARCH: x64 + PLATFORM: x64 + - ARCH: arm64 + PLATFORM: ARM64 + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Configure build + run: cmake -B build -G "Visual Studio 17 2022" -A ${{matrix.PLATFORM}} ${{env.SPVC_PARAMS}} + - name: Build + run: cmake --build build --parallel --config Release + - name: Upload artifact + run: aws s3 cp build\Release\spirv-cross-c-shared.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/spirv-cross.dll ${{env.S3_PARAMS}} + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > spirv-cross.dll.git + aws s3 cp spirv-cross.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c2e81cb58..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2020-2021 The Khronos Group, Inc. -# SPDX-License-Identifier: Apache-2.0 - -name: CI - -on: - push: - branches: [ main ] - pull_request: - types: [ opened, synchronize, reopened ] - -jobs: - build: - name: "Build ${{ matrix.platform }}" - strategy: - matrix: - platform: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-latest] - env: - PARALLEL: -j 2 - - runs-on: "${{ matrix.platform }}" - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Cache glslang / SPIRV-Tools - id: cache-externals - uses: actions/cache@v3 - with: - path: external/*-build/output - key: ${{ matrix.platform }} externals ${{ hashFiles('checkout_glslang_spirv_tools.sh', 'build_glslang_spirv_tools.sh') }} - - - name: Pull glslang / SPIRV-Tools - if: steps.cache-externals.outputs.cache-hit != 'true' - shell: bash - working-directory: ${{github.workspace}} - run: ./checkout_glslang_spirv_tools.sh - - - name: Build glslang / SPIRV-Tools - if: steps.cache-externals.outputs.cache-hit != 'true' - shell: bash - working-directory: ${{github.workspace}} - run: ./build_glslang_spirv_tools.sh Release 4 - - - name: Configure SPIRV-Cross - shell: bash - run: | - mkdir build - cd build - cmake .. -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_MISC_WARNINGS=ON -DSPIRV_CROSS_SHARED=ON -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release -DSPIRV_CROSS_ENABLE_TESTS=ON - - - name: Build SPIRV-Cross - shell: bash - working-directory: ${{github.workspace}}/build - run: | - cmake --build . --config Release --parallel 4 - cmake --build . --config Release --target install - - - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.platform }}-binaries - path: build/output - - name: Test SPIRV-Cross - shell: bash - working-directory: ${{github.workspace}}/build - run: ctest --verbose -C Release - reuse: - name: "REUSE license check" - runs-on: ubuntu-latest - container: khronosgroup/docker-images:asciidoctor-spec - - steps: - - uses: actions/checkout@v3 - - # REUSE license checker - - name: license-check - run: | - reuse lint - - diff --git a/XCompile-lwjgl.cmake b/XCompile-lwjgl.cmake new file mode 100644 index 000000000..8cfa94e78 --- /dev/null +++ b/XCompile-lwjgl.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_SYSTEM_NAME "${SYSTEM_NAME}") +SET(CMAKE_SYSTEM_PROCESSOR "${SYSTEM_PROCESSOR}") \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index cc2fade27..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2016-2021 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 - -environment: - matrix: - - GENERATOR: "Visual Studio 12 2013 Win64" - CONFIG: Debug - - - GENERATOR: "Visual Studio 12 2013 Win64" - CONFIG: Release - - - GENERATOR: "Visual Studio 14 2015 Win64" - CONFIG: Debug - - - GENERATOR: "Visual Studio 14 2015 Win64" - CONFIG: Release - - - GENERATOR: "Visual Studio 12 2013" - CONFIG: Debug - - - GENERATOR: "Visual Studio 12 2013" - CONFIG: Release - - - GENERATOR: "Visual Studio 14 2015" - CONFIG: Debug - - - GENERATOR: "Visual Studio 14 2015" - CONFIG: Release - -build_script: - - git submodule update --init - - cmake "-G%GENERATOR%" -H. -B_builds - - cmake --build _builds --config "%CONFIG%"