81 lines
2.8 KiB
YAML
81 lines
2.8 KiB
YAML
name: Celestia
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
BUILD_TYPE: RelWithDebInfo
|
|
CTEST_OUTPUT_ON_FAILURE: 1
|
|
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [x64, x86]
|
|
generator_platform: [x64, Win32]
|
|
include:
|
|
- platform: x64
|
|
generator_platform: x64
|
|
- platform: x86
|
|
generator_platform: Win32
|
|
exclude:
|
|
- platform: x64
|
|
generator_platform: Win32
|
|
- platform: x86
|
|
generator_platform: x64
|
|
|
|
steps:
|
|
- name: 'Setup NuGet Credentials'
|
|
shell: 'bash'
|
|
run: >
|
|
$(c:/vcpkg/vcpkg fetch nuget | tail -n 1)
|
|
sources add
|
|
-source "https://nuget.pkg.github.com/CelestiaProject/index.json"
|
|
-storepasswordincleartext
|
|
-name "GitHub"
|
|
-username "CelestiaProject"
|
|
-password "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
- name: 'Install dependencies'
|
|
run: vcpkg --triplet=${{matrix.platform}}-windows install --recurse libpng libjpeg-turbo gettext luajit fmt libepoxy eigen3 freetype cspice qt5-base
|
|
|
|
- name: 'Checkout source code'
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 'Configure CMake'
|
|
run: cmake -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows -DCMAKE_GENERATOR_PLATFORM=${{matrix.generator_platform}} -DENABLE_SPICE=ON -DENABLE_TOOLS=ON -DENABLE_TESTS=ON -DENABLE_SDL=OFF -DENABLE_QT=ON -DENABLE_DATA=OFF
|
|
|
|
- name: Build
|
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- /maxcpucount:2 /nologo
|
|
|
|
- name: 'Copy DLL for tests'
|
|
working-directory: ${{github.workspace}}/build
|
|
run: copy src\celestia\${{env.BUILD_TYPE}}\*.dll test\unit\${{env.BUILD_TYPE}}\
|
|
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
run: ctest -C ${{env.BUILD_TYPE}}
|
|
|
|
- name: Package artifacts
|
|
working-directory: ${{github.workspace}}/build/src/celestia
|
|
run: |
|
|
7z a celestia-dep.${{matrix.platform}}.7z ${{env.BUILD_TYPE}}\*
|
|
7z a celestia-win.${{matrix.platform}}.7z win32\${{env.BUILD_TYPE}}\* win32\res\${{env.BUILD_TYPE}}\res_*.dll
|
|
c:\vcpkg\ports\qt5-base\qtdeploy.ps1 qt\${{env.BUILD_TYPE}}\
|
|
7z a celestia-qt.${{matrix.platform}}.7z qt\${{env.BUILD_TYPE}}\*
|
|
cd ..\tools
|
|
7z a celestia-tools.${{matrix.platform}}.7z xyzv2bin\${{env.BUILD_TYPE}}\*.exe spice2xyzv\${{env.BUILD_TYPE}}\*.exe
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
if: success()
|
|
with:
|
|
name: celestia-${{matrix.platform}}
|
|
path: ${{github.workspace}}/build/src/*/*.7z
|