Skip to content

Commit

Permalink
Add basic github actions build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 15, 2019
1 parent a952fd4 commit 81e1cc7
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 9 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI
on: [push]

jobs:
Windows:
timeout-minutes: 15
runs-on: windows-2019

env:
MYSQL_VERSION: mysql-5.7.14-win32
QSCINTILLA_VERSION: QScintilla_gpl-2.10.8

steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive

- name: Set environment
shell: cmd
run: |
set GRABBER_VERSION=nightly
set GRABBER_IS_NIGHTLY=1
set PLATFORM_NAME=x64
- name: Vendor cache
uses: actions/cache@v1
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: Create vendor dir
shell: cmd
run: mkdir vendor

- name: Install Qt
uses: jurplel/install-qt-action@v1.0.0
with:
version: 5.12.3
dir: ${{ env.GITHUB_WORKSPACE }}\vendor\Qt

- name: Install OpenSSL
working-directory: vendor
shell: cmd
run: |
curl -Lo OpenSSL.exe https://slproweb.com/download/Win64OpenSSL-1_0_2t.exe
set OPENSSL_ROOT_DIR="%GITHUB_WORKSPACE%\vendor\OpenSSL"
OpenSSL.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="%OPENSSL_ROOT_DIR%"
- name: Install QScintilla
working-directory: vendor
shell: cmd
run: |
curl -Lo "%QSCINTILLA_VERSION%.zip" "https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10.8/%QSCINTILLA_VERSION%.zip"
7z x "%QSCINTILLA_VERSION%.zip" -y
cd "%QSCINTILLA_VERSION%\Qt4Qt5"
call "%Qt5_Dir%\bin\qtenv2.bat"
qmake qscintilla.pro
nmake
nmake install
cd ..\..
- name: Download MySQL
working-directory: vendor
shell: cmd
run: |
curl -Lo "%MYSQL_VERSION%.zip" "https://dev.mysql.com/get/Downloads/MySQL-5.7/%MYSQL_VERSION%.zip"
7z x "%MYSQL_VERSION%.zip" -y
set MYSQL_INSTALL_DIR=%GITHUB_WORKSPACE%\vendor\%MYSQL_VERSION%
- name: Download APNG plugin
working-directory: vendor
shell: cmd
run: |
curl -Lo APNG.7z https://install.skycoder42.de/qtmodules/windows_x86/qt5123/qt.qt5.5123.skycoder42.apng.win64_msvc2017_64/1.1.1-35.12.3.7z
7z x APNG.7z -y -oAPNG
set APNG_PLUGIN_DLL=%GITHUB_WORKSPACE%\vendor\APNG\5.12.3\msvc2017\plugins\imageformats\qapng.dll
- name: Create build dir
shell: cmd
run: mkdir build

- name: Configure
working-directory: build
shell: cmd
run: cmake .. -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DNIGHTLY=%GRABBER_IS_NIGHTLY% -DCOMMIT="%GITHUB_SHA%" -DVERSION="%GRABBER_VERSION%"

- name: Compile
working-directory: build
shell: cmd
run: cmake --build . --config Release -j 4

- name: Test
shell: cmd
run: "%GITHUB_WORKSPACE%\\build\\tests\\Release\\tests.exe"

- name: Generate installer
shell: cmd
run: iscc /Q /DMyAppVersion="%GRABBER_VERSION%" /DPlatformName="%PLATFORM_NAME%" /DQtDir="%Qt5_Dir%\bin" /DOpenSSLDir="%OPENSSL_ROOT_DIR%" /DMySQLDir="%MYSQL_INSTALL_DIR%" /DQtApngDll="%APNG_PLUGIN_DLL%" releases\setup.iss
21 changes: 12 additions & 9 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ if(DEFINED ENV{TRAVIS})
endif()

# Disable Google Breakpad if the provided folder does not exist
if((DEFINED BREAKPAD) AND (NOT EXISTS "${BREAKPAD}"))
message(WARNING "Provided Google Breakpad directory does not exist, disabling Google Breakpad: ${BREAKPAD}")
set(USE_BREAKPAD 0)
if(USE_BREAKPAD)
if(NOT DEFINED BREAKPAD)
if(WIN32)
set(BREAKPAD "D:/bin/google-breakpad")
elseif(UNIX)
set(BREAKPAD "~/Programmation/google-breakpad")
endif()
endif()
if((NOT DEFINED BREAKPAD) OR (NOT EXISTS "${BREAKPAD}"))
message(WARNING "Provided Google Breakpad directory does not exist, disabling Google Breakpad: ${BREAKPAD}")
set(USE_BREAKPAD 0)
endif()
endif()

# Nightly version settings
Expand Down Expand Up @@ -90,9 +99,6 @@ if(USE_BREAKPAD)
if(WIN32)
set(CMAKE_LFLAGS_RELEASE "${CMAKE_LFLAGS_RELEASE} /INCREMENTAL:NO /DEBUG")
set(CMAKE_CFLAGS_RELEASE "${CMAKE_CFLAGS_RELEASE} -O2 -MD -zi")
if(NOT DEFINED BREAKPAD)
set(BREAKPAD "D:/bin/google-breakpad")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
list(APPEND LIBS
"${BREAKPAD}/src/client/windows/Release/lib/common.lib"
Expand All @@ -106,9 +112,6 @@ if(USE_BREAKPAD)
endif()
elseif(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
if(NOT DEFINED BREAKPAD)
set(BREAKPAD "~/Programmation/google-breakpad")
endif()
list(APPEND LIBS "${BREAKPAD}/src/client/linux/libbreakpad_client.a")
endif()
message(STATUS "Using Google Breakpad from ${BREAKPAD}")
Expand Down

0 comments on commit 81e1cc7

Please sign in to comment.