👷 Fix CI build

This commit is contained in:
Edgar 2021-02-14 13:41:36 +01:00 committed by Rasmus Karlsson
parent 1f95e63aa7
commit 0fe0a58373
6 changed files with 30 additions and 32 deletions

View file

@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [windows-latest, ubuntu-latest, macos-latest] os: [windows-latest, ubuntu-20.04, macos-latest]
qt-version: [5.15.2, 5.12.10] qt-version: [5.15.2, 5.12.10]
build-system: [qmake, cmake] build-system: [qmake, cmake]
fail-fast: false fail-fast: false
@ -53,31 +53,29 @@ jobs:
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.4 uses: actions/cache@v2.1.4
with: with:
key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile-qmake.txt') }} key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan path: ~/.conan
- name: Cache conan packages - name: Cache conan packages
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.4 uses: actions/cache@v2.1.4
with: with:
key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile-qmake.txt') }} key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile.txt') }}
path: C:/.conan/ path: C:/.conan/
- name: Install dependencies (Windows) - name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
run: | run: choco install conan jom -y
choco install conan jom -y
refreshenv
shell: cmd shell: cmd
- name: Build (Windows) - name: Build (Windows)
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake' if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake'
run: | run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
SET PATH=%PATH%;C:\Program Files\Conan\conan\
mkdir build mkdir build
cd build cd build
"C:\Program Files\Conan\conan\conan.exe" install ..\conanfile-qmake.txt conan install ..\conanfile-qmake.txt
qmake .. qmake ..
jom jom
windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/ windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
@ -90,15 +88,14 @@ jobs:
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'cmake' if: startsWith(matrix.os, 'windows') && matrix.build-system == 'cmake'
run: | run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
SET PATH=%PATH%;C:\Program Files\Conan\conan\
mkdir build mkdir build
cd build cd build
"C:\Program Files\Conan\conan\conan.exe" install ..\conanfile-qmake.txt cmake -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON ..
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release .. jom
nmake jom copy_dll
windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/ echo nightly > bin/modes
cp release/chatterino.exe Chatterino2/ 7z a chatterino-windows-x86-64.zip bin/
echo nightly > Chatterino2/modes
7z a chatterino-windows-x86-64.zip Chatterino2/
shell: cmd shell: cmd
- name: Upload artifact (Windows) - name: Upload artifact (Windows)
@ -115,6 +112,8 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get -y install \ sudo apt-get -y install \
cmake \ cmake \
virtualenv \
rapidjson-dev \
libssl-dev \ libssl-dev \
libboost-dev \ libboost-dev \
libboost-system-dev \ libboost-system-dev \
@ -144,7 +143,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr .. cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON ..
make -j8 make -j8
shell: bash shell: bash
@ -183,7 +182,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake .. cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON ..
make -j8 make -j8
shell: bash shell: bash

View file

@ -49,10 +49,10 @@ jobs:
- name: Install dependencies (Ubuntu) - name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get update sudo apt-get update
sudo apt-get -y install \ sudo apt-get -y install \
cmake \ cmake \
virtualenv \
rapidjson-dev \ rapidjson-dev \
libssl-dev \ libssl-dev \
libboost-dev \ libboost-dev \
@ -75,9 +75,6 @@ jobs:
run: mkdir build-test run: mkdir build-test
shell: bash shell: bash
- name: Add conan pkgs
run: cmake -P conan-pkgs/add_conan_pkgs.cmake
- name: Build (Ubuntu) - name: Build (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |
@ -88,8 +85,7 @@ jobs:
- name: Test (Ubuntu) - name: Test (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: ./bin/chatterino-test --platform minimal
./chatterino-test --platform minimal
working-directory: build-test working-directory: build-test
shell: bash shell: bash

View file

@ -35,7 +35,7 @@ endif()
if (USE_PACKAGE_MANAGER) if (USE_PACKAGE_MANAGER)
include(pmm) include(pmm)
pmm(CONAN) pmm(CONAN REMOTES anotherfoxguy-artifactory https://anotherfoxguy.jfrog.io/artifactory/api/conan/chatterino)
else (USE_PACKAGE_MANAGER) else (USE_PACKAGE_MANAGER)
set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/dependencies" CACHE PATH "Path to the dependencies") set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/dependencies" CACHE PATH "Path to the dependencies")

View file

@ -219,8 +219,11 @@ generate_source_groups(${SOURCE_FILES})
add_executable(${PROJECT_NAME} ${SOURCE_FILES}) add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_compile_definitions(${PROJECT_NAME} PRIVATE CMAKE_BUILD CHATTERINO UNICODE USEWINSDK AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) target_compile_definitions(${PROJECT_NAME} PRIVATE CMAKE_BUILD CHATTERINO UNICODE AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi)
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\") target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\")
if (WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE USEWINSDK)
endif ()
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -11,8 +11,6 @@
#else #else
# include "keychain.h" # include "keychain.h"
#endif #endif
#include <QSaveFile> #include <QSaveFile>
#include <boost/variant.hpp> #include <boost/variant.hpp>

View file

@ -1,6 +1,6 @@
include(GoogleTest) include(GoogleTest)
project(chatterino-tests) project(chatterino-test)
set(main_dir ${CMAKE_SOURCE_DIR}/src) set(main_dir ${CMAKE_SOURCE_DIR}/src)
@ -62,8 +62,10 @@ else ()
) )
endif () endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO CHATTERINO_TEST UNICODE USEWINSDK AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO CHATTERINO_TEST UNICODE AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi)
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\") target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\")
if (WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE USEWINSDK)
endif ()
#gtest_discover_tests(${PROJECT_NAME}) #gtest_discover_tests(${PROJECT_NAME})