From 1791e1f71cd90a301fdc7e207c6c9d043ab103f1 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 10 Jul 2022 15:36:17 +0100 Subject: [PATCH] Replace AppVeyor with GitHub Actions --- .github/workflows/Linux_x86.yml | 2 +- .github/workflows/Linux_x86_64_SDL1.yml | 2 +- .github/workflows/Linux_x86_64_test.yml | 2 +- .github/workflows/Windows_MSVC_x64.yml | 42 ++++++++++ ...{Windows_x64.yml => Windows_MinGW_x64.yml} | 6 +- ...{Windows_x86.yml => Windows_MinGW_x86.yml} | 2 +- .github/workflows/xbox_one.yml | 41 +++++++++ CMakeLists.txt | 3 +- CMakePresets.json | 84 +++++++++++++++++++ README.md | 9 +- appveyor.yml | 58 ------------- 11 files changed, 181 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/Windows_MSVC_x64.yml rename .github/workflows/{Windows_x64.yml => Windows_MinGW_x64.yml} (95%) rename .github/workflows/{Windows_x86.yml => Windows_MinGW_x86.yml} (98%) create mode 100644 .github/workflows/xbox_one.yml create mode 100644 CMakePresets.json delete mode 100644 appveyor.yml diff --git a/.github/workflows/Linux_x86.yml b/.github/workflows/Linux_x86.yml index e3d5e9912..8745656c9 100644 --- a/.github/workflows/Linux_x86.yml +++ b/.github/workflows/Linux_x86.yml @@ -1,4 +1,4 @@ -name: Linux_x86 +name: Linux x86 on: push: diff --git a/.github/workflows/Linux_x86_64_SDL1.yml b/.github/workflows/Linux_x86_64_SDL1.yml index 05fab2935..2a75f569d 100644 --- a/.github/workflows/Linux_x86_64_SDL1.yml +++ b/.github/workflows/Linux_x86_64_SDL1.yml @@ -1,4 +1,4 @@ -name: Linux_x86_64_SDL1 +name: Linux x64 SDL1 on: push: diff --git a/.github/workflows/Linux_x86_64_test.yml b/.github/workflows/Linux_x86_64_test.yml index a7f11e2fe..9f62be733 100644 --- a/.github/workflows/Linux_x86_64_test.yml +++ b/.github/workflows/Linux_x86_64_test.yml @@ -1,4 +1,4 @@ -name: Linux_x86_64_test +name: Linux x64 Tests on: push: diff --git a/.github/workflows/Windows_MSVC_x64.yml b/.github/workflows/Windows_MSVC_x64.yml new file mode 100644 index 000000000..f9dc8bb85 --- /dev/null +++ b/.github/workflows/Windows_MSVC_x64.yml @@ -0,0 +1,42 @@ +name: Windows MSVC x64 + +on: + push: + branches: + - master + pull_request: + types: [ opened, synchronize ] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + + - name: Install latest CMake + uses: lukka/get-cmake@latest + + - name: Restore or setup vcpkg + uses: lukka/run-vcpkg@v10 + with: + vcpkgGitCommitId: '98f8d00e89fb6a8019c2045cfa1edbe9d92d3405' + + - name: Run CMake consuming CMakePresets.json and vcpkg.json by mean of vcpkg. + uses: lukka/run-cmake@v10 + with: + configurePreset: 'ninja-vcpkg-debug' + buildPreset: 'ninja-vcpkg-debug' + testPreset: 'ninja-vcpkg-debug' + + - name: Upload-Package + if: ${{ !env.ACT }} + uses: actions/upload-artifact@v2 + with: + name: devilutionx.exe + path: build-ninja-vcpkg-debug/devilutionx.exe diff --git a/.github/workflows/Windows_x64.yml b/.github/workflows/Windows_MinGW_x64.yml similarity index 95% rename from .github/workflows/Windows_x64.yml rename to .github/workflows/Windows_MinGW_x64.yml index e7f7a6279..04cc3e532 100644 --- a/.github/workflows/Windows_x64.yml +++ b/.github/workflows/Windows_MinGW_x64.yml @@ -1,4 +1,4 @@ -name: Windows_x64 +name: Windows MinGW x64 on: push: @@ -39,7 +39,7 @@ jobs: with: name: devilutionx_x64.zip path: build/devilutionx.zip - + - name: Upload artifacts as release in storage repo if: ${{ !env.ACT && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }} uses: svenstaro/upload-release-action@v2 @@ -50,4 +50,4 @@ jobs: asset_name: artifacts.zip tag: "WIN64-${{ github.sha }}" overwrite: true - body: ${{ github.event.head_commit.message }} \ No newline at end of file + body: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/Windows_x86.yml b/.github/workflows/Windows_MinGW_x86.yml similarity index 98% rename from .github/workflows/Windows_x86.yml rename to .github/workflows/Windows_MinGW_x86.yml index 3f4864f4d..c2e250eda 100644 --- a/.github/workflows/Windows_x86.yml +++ b/.github/workflows/Windows_MinGW_x86.yml @@ -1,4 +1,4 @@ -name: Windows_x86 +name: Windows MinGW x86 on: push: diff --git a/.github/workflows/xbox_one.yml b/.github/workflows/xbox_one.yml new file mode 100644 index 000000000..9713951d4 --- /dev/null +++ b/.github/workflows/xbox_one.yml @@ -0,0 +1,41 @@ +name: Xbox One / Series + +on: + push: + branches: + - master + pull_request: + types: [ opened, synchronize ] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: x64 + + - name: Build + shell: cmd + run: | + cd ${{ github.workspace }}\Packaging\xbox-one + build.bat + + - name: Upload-Package + if: ${{ !env.ACT }} + uses: actions/upload-artifact@v3 + with: + name: devilutionx-xbox-one.zip + if-no-files-found: error + path: | + build/uwp-project/AppxPackages/**/Microsoft.VCLibs.x64.*.appx + build/uwp-project/Release/**/devilutionX_*_x64.appx diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c384755..ea355d180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,7 +188,8 @@ endif() find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") endif() if(DEVILUTIONX_DISABLE_RTTI) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..6a0c8b3e4 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,84 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 19, + "patch": 0 + }, + "configurePresets": [ + { + "name": "ninja-vcpkg", + "displayName": "Ninja with VcPkg Configure Settings", + "description": "Configure with vcpkg toolchain", + "binaryDir": "${sourceDir}/build-${presetName}", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + } + } + }, + { + "name": "ninja-vcpkg-debug", + "displayName": "Ninja with VcPkg Configure Settings with CMAKE_BUILD_TYPE=RelWithDebInfo", + "inherits": "ninja-vcpkg", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "ninja-vcpkg-relwithdebinfo", + "displayName": "Ninja with VcPkg Configure Settings with CMAKE_BUILD_TYPE=RelWithDebInfo", + "inherits": "ninja-vcpkg", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "ninja-vcpkg-discord-relwithdebinfo", + "displayName": "Ninja with VcPkg Configure Settings with DISCORD_INTEGRATION=ON CMAKE_BUILD_TYPE=RelWithDebInfo", + "inherits": "ninja-vcpkg-relwithdebinfo", + "cacheVariables": { + "DISCORD_INTEGRATION": { + "type": "BOOL", + "value": "ON" + } + } + } + ], + "buildPresets": [ + { + "name": "ninja-vcpkg-debug", + "configurePreset": "ninja-vcpkg-debug", + "displayName": "Build ninja-vcpkg-debug", + "description": "Build ninja-vcpkg-debug Configuration" + }, + { + "name": "ninja-vcpkg-relwithdebinfo", + "configurePreset": "ninja-vcpkg-relwithdebinfo", + "displayName": "Build ninja-vcpkg-relwithdebinfo", + "description": "Build ninja-vcpkg-relwithdebinfo Configuration" + }, + { + "name": "ninja-vcpkg-discord-relwithdebinfo", + "configurePreset": "ninja-vcpkg-discord-relwithdebinfo", + "displayName": "Build ninja-vcpkg-discord-relwithdebinfo", + "description": "Build ninja-vcpkg-discord-relwithdebinfo Configuration" + } + ], + "testPresets": [ + { + "name": "ninja-vcpkg-debug", + "configurePreset": "ninja-vcpkg-debug" + }, + { + "name": "ninja-vcpkg-relwithdebinfo", + "configurePreset": "ninja-vcpkg-relwithdebinfo" + }, + { + "name": "ninja-vcpkg-discord-relwithdebinfo", + "configurePreset": "ninja-vcpkg-discord-relwithdebinfo" + } + ] +} diff --git a/README.md b/README.md index c74c1bd7f..b2e7af69a 100644 --- a/README.md +++ b/README.md @@ -51,16 +51,17 @@ If you want to help test the latest state of the next version you can fetch the [![Linux x86](https://github.com/diasurgical/devilutionX/actions/workflows/Linux_x86.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Linux_x86.yml?query=branch%3Amaster) [![Linux x86-64 SDL1](https://github.com/diasurgical/devilutionX/actions/workflows/Linux_x86_64_SDL1.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Linux_x86_64_SDL1.yml?query=branch%3Amaster) [![MacOSX](https://github.com/diasurgical/devilutionX/actions/workflows/MacOSX.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/MacOSX.yml?query=branch%3Amaster) -[![Windows x64](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_x64.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_x64.yml?query=branch%3Amaster) -[![Windows x86](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_x86.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_x86.yml?query=branch%3Amaster) +[![Windows x64](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MSVC_x64.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MSVC_x64.yml?query=branch%3Amaster) +[![Windows MinGW x64](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MinGW_x64.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MinGW_x64.yml?query=branch%3Amaster) +[![Windows MinGW x86](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MinGW_x86.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Windows_MinGW_x86.yml?query=branch%3Amaster) [![Android](https://github.com/diasurgical/devilutionX/actions/workflows/Android.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/Android.yml?query=branch%3Amaster) [![iOS](https://github.com/diasurgical/devilutionX/actions/workflows/iOS.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/iOS.yml?query=branch%3Amaster) [![PS4](https://github.com/diasurgical/devilutionX/actions/workflows/PS4.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/PS4.yml?query=branch%3Amaster) +[![Original Xbox](https://github.com/diasurgical/devilutionX/actions/workflows/xbox_nxdk.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/xbox_nxdk.yml?query=branch%3Amaster) +[![Xbox One/Series](https://github.com/diasurgical/devilutionX/actions/workflows/xbox_one.yml/badge.svg)](https://github.com/diasurgical/devilutionX/actions/workflows/xbox_one.yml?query=branch%3Amaster) Linux x86-64, Switch, Vita, 3DS, Amiga, [![CircleCI](https://circleci.com/gh/diasurgical/devilutionX.svg?style=shield)](https://app.circleci.com/pipelines/github/diasurgical/devilutionX?branch=master) -Xbox One/Series, MSVC [![AppVeyor](https://ci.appveyor.com/api/projects/status/1a0jus2372qvksht/branch/master?svg=true)](https://ci.appveyor.com/project/AJenbo/devilutionx) - # Building from Source Want to compile the program by yourself? Great! Simply follow the [build instructions](./docs/building.md). diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7d416e9f4..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 1.1.{build} - -pull_requests: - do_not_increment_build_number: true -environment: - matrix: - - - job_name: windows - appveyor_build_worker_image: Visual Studio 2022 - - - job_name: uwp - appveyor_build_worker_image: Visual Studio 2022 - -for: - - - matrix: - only: - - job_name: windows - - cache: '%LOCALAPPDATA%\vcpkg\archives' - - install: - - if not exist C:\Tools\vcpkg mkdir C:\Tools\vcpkg - - cd C:\Tools\vcpkg - - git pull - - .\bootstrap-vcpkg.bat - - cd %APPVEYOR_BUILD_FOLDER% - - before_build: - - cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake . - - build: - project: $(APPVEYOR_BUILD_FOLDER)\$(APPVEYOR_PROJECT_NAME).sln - parallel: true - verbosity: minimal - - artifacts: - - path: Debug\devilutionx.exe - name: devilutionx.exe - - - - matrix: - only: - - job_name: uwp - - before_build: - - cd %APPVEYOR_BUILD_FOLDER%\Packaging\xbox-one - - if exist ..\..\build rd /s /q ..\..\build - - build_script: - - build.bat - - after_build: - - cd %APPVEYOR_BUILD_FOLDER% - - artifacts: - - path: devilutionx.zip - name: devilutionx.zip