metaforce/.github/workflows/build.yml

273 lines
8.5 KiB
YAML

name: Build
on:
push:
branches:
- master
pull_request:
jobs:
build-linux-gcc:
name: Build Linux (GCC x86_64)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default
- name: Create build directory
shell: bash
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DURDE_VECTOR_ISA=sse41 \
-DURDE_DLPACKAGE=urde-$GITHUB_RUN_NUMBER-linux-gcc-x86_64
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Generate AppImage
env:
VERSION: ${{github.run_number}}
run: ci/build-appimage.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: urde-linux-gcc-x86_64
path: URDE-*.AppImage
build-linux-clang:
name: Build Linux (Clang x86_64)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DURDE_VECTOR_ISA=sse41 \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DURDE_DLPACKAGE=urde-$GITHUB_RUN_NUMBER-linux-clang-x86_64
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Generate AppImage
env:
VERSION: ${{github.run_number}}
run: ci/build-appimage.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: urde-linux-clang-x86_64
path: URDE-*.AppImage
build-macos:
name: Build macOS (Clang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: brew install ninja qt
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DURDE_VECTOR_ISA=sse41
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: urde-macos-x86_64
path: build/Binaries/urde.app
build-windows-msvc:
name: Build Windows (MSVC x86_64)
runs-on: [ self-hosted, windows, x64 ]
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 6.0.2
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v1
with:
path: ../LLVM
key: ${{runner.os}}-LLVMCache-${{env.LLVM_VERSION}}
- name: Download LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: suisei-cn/actions-download-file@v1
id: download-llvm
with:
url: https://axiodl.com/files/LLVM-${{env.LLVM_VERSION}}-win64.exe
target: ../temp
- name: Install LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
shell: cmd
working-directory: ../temp
run: ${{steps.download-llvm.outputs.filename}} /S /D=%RUNNER_WORKSPACE%\LLVM
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{runner.os}}-QtCache-${{env.Qt_VERSION}}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{env.Qt_VERSION}}
cached: ${{steps.cache-qt.outputs.cache-hit}}
# - name: Install dependencies
# run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DURDE_VECTOR_ISA=sse41 `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
-DLLVM_ROOT_DIR="$env:RUNNER_WORKSPACE/LLVM" `
-DURDE_DLPACKAGE=urde-$env:GITHUB_RUN_NUMBER-win32-msvc-x86_64
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: urde-windows-msvc-x86_64
path: |
build/Binaries/urde.exe
build/Binaries/hecl.exe
build/Binaries/hecl-gui.exe
build/Binaries/visigen.exe
build-windows-clang:
name: Build Windows (Clang x86_64)
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 6.0.2
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v1
with:
path: ../LLVM
key: ${{runner.os}}-LLVMCache-${{env.LLVM_VERSION}}
- name: Download LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: suisei-cn/actions-download-file@v1
id: download-llvm
with:
url: https://axiodl.com/files/LLVM-${{env.LLVM_VERSION}}-win64.exe
target: ../temp
- name: Install LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
shell: cmd
working-directory: ../temp
run: ${{steps.download-llvm.outputs.filename}} /S /D=%RUNNER_WORKSPACE%\LLVM
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{runner.os}}-QtCache-${{env.Qt_VERSION}}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{env.Qt_VERSION}}
cached: ${{steps.cache-qt.outputs.cache-hit}}
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DURDE_VECTOR_ISA=sse41 `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" `
-DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" `
-DCMAKE_LINKER="C:/Program Files/LLVM/bin/lld-link.exe" `
-DLLVM_ROOT_DIR="$env:RUNNER_WORKSPACE/LLVM" `
-DURDE_DLPACKAGE=urde-$env:GITHUB_RUN_NUMBER-win32-clang-x86_64
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: urde-windows-clang-x86_64
path: |
build/Binaries/urde.exe
build/Binaries/hecl.exe
build/Binaries/hecl-gui.exe
build/Binaries/visigen.exe