From 5b26f652496332c76d0982ebcd3ad009970bbcc7 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 26 Mar 2021 18:21:53 -0400 Subject: [PATCH] CI test --- .github/workflows/build.yml | 150 ++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- CMakeSettings.json | 156 ++++++++++++++++++++++++++++++------ 3 files changed, 281 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..034759fc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,150 @@ +name: Build + +on: + push: + branches: + - ci + paths-ignore: + - '*.md' + - 'CMakeSettings.json' + - 'LICENSE' +# 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 cmake ninja-build 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=Release + + - 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: pwe-${{github.run_number}}-linux-gcc-x86_64 +# path: PrimeWorldEditor-*.AppImage + + build-macos: + name: Build macOS (AppleClang x86_64) + runs-on: macos-10.15 + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install dependencies + run: | + brew install ninja qt@5 graphicsmagick imagemagick + brew link qt@5 + yarn global add create-dmg + + - name: Create build directory + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: | + export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove + cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=Release + + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + +# - name: Import signing certificate +# uses: devbotsxyz/xcode-import-certificate@master +# with: +# certificate-data: ${{ secrets.MACOS_CERTIFICATE_DATA }} +# certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} +# keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} +# +# - name: Deploy & codesign application +# working-directory: build/Binaries +# run: | +# macdeployqt PrimeWorldEditor.app -sign-for-notarization="${{secrets.MACOS_CODESIGN_IDENT}}" -no-strip +# create-dmg PrimeWorldEditor.app --identity="${{secrets.MACOS_CODESIGN_IDENT}}" +# xcrun altool -t osx -f *.dmg --primary-bundle-id com.axiodl.PrimeWorldEditor --notarize-app \ +# -u "${{secrets.MACOS_ASC_USERNAME}}" -p "${{secrets.MACOS_ASC_PASSWORD}}" \ +# --team-id "${{secrets.MACOS_ASC_TEAM_ID}}" +# +# - name: Upload artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: urde-${{github.run_number}}-macos-appleclang-x86_64 +# path: build/Binaries/*.dmg + + build-windows-msvc: + name: Build Windows (MSVC x86_64) + runs-on: windows-2019 + env: + Qt_VERSION: 5.15.2 + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install vcpkg Qt + run: | + $TempDir = "$env:RUNNER_WORKSPACE\temp" + $Filename = "vcpkg-qt-$env:Qt_VERSION.7z" + New-Item -Path "$TempDir" -ItemType Directory -ea 0 + (New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename") + 7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename" + + - name: Install dependencies + run: choco install ninja + + - 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: | + $workspace = $env:RUNNER_WORKSPACE -replace '\\', '/' + cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" ` + -DVCPKG_TARGET_TRIPLET=x64-windows-static ` + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded + + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + +# - name: Upload artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: urde-${{github.run_number}}-win32-msvc-x86_64 +# path: | +# build/Binaries/urde.exe +# build/Binaries/hecl.exe +# build/Binaries/hecl-gui.exe +# build/Binaries/visigen.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index b2f5dbc2..b422f182 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -set(MACOSX_DEPLOYMENT_TARGET 10.10) +set(MACOSX_DEPLOYMENT_TARGET 10.14) # Use release build type as default (assimp complains if this is unset) if(NOT CMAKE_BUILD_TYPE) diff --git a/CMakeSettings.json b/CMakeSettings.json index 17ca55e2..29b9c77b 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,28 +1,132 @@ { - "configurations": [ - { - "name": "x64-Debug", - "generator": "Ninja", - "configurationType": "Debug", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", - "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", - "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5", - "buildCommandArgs": "", - "ctestCommandArgs": "", - "variables": [] - }, - { - "name": "x64-Release", - "generator": "Ninja", - "configurationType": "RelWithDebInfo", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", - "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", - "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5", - "buildCommandArgs": "", - "ctestCommandArgs": "", - "variables": [] - } - ] + "configurations": [ + { + "name": "x64-Clang-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "clang_cl_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreadedDebugDLL", + "type": "STRING" + } + ] + }, + { + "name": "x64-Clang-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "inheritEnvironments": [ "clang_cl_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreadedDLL", + "type": "STRING" + } + ] + }, + { + "name": "x64-Clang-Release-vcpkg", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "inheritEnvironments": [ "clang_cl_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake", + "type": "FILEPATH" + }, + { + "name": "VCPKG_TARGET_TRIPLET", + "value": "x64-windows-static", + "type": "STRING" + }, + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreaded", + "type": "STRING" + } + ] + }, + { + "name": "x64-MSVC-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [ + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreadedDebugDLL", + "type": "STRING" + } + ] + }, + { + "name": "x64-MSVC-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [ + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreadedDLL", + "type": "STRING" + } + ] + }, + { + "name": "x64-MSVC-Release-vcpkg", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake", + "type": "FILEPATH" + }, + { + "name": "VCPKG_TARGET_TRIPLET", + "value": "x64-windows-static", + "type": "STRING" + }, + { + "name": "CMAKE_MSVC_RUNTIME_LIBRARY", + "value": "MultiThreaded", + "type": "STRING" + } + ] + } + ] } \ No newline at end of file