From 07450e9fe80913d280b80cb6eec11572c015ff1c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 06:36:47 -0600 Subject: Add tests aopacket --- CMakeLists.txt | 16 ++++++++++++++++ README_TEST.md | 8 ++++++++ test/CMakeLists.txt | 6 ++++++ test/test_aopacket.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 README_TEST.md create mode 100644 test/CMakeLists.txt create mode 100644 test/test_aopacket.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..322c90c5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1.0) + +project(ao) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +if(CMAKE_VERSION VERSION_LESS "3.7.0") + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + +add_subdirectory(test) diff --git a/README_TEST.md b/README_TEST.md new file mode 100644 index 00000000..c426badf --- /dev/null +++ b/README_TEST.md @@ -0,0 +1,8 @@ +Running tests requires Catch2 and cmake + +```sh +mkdir cbuild && cd cbuild +cmake .. +make +./test/test +``` diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000..cc02859e --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,6 @@ +find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(Catch2 REQUIRED) + +add_executable(test test_aopacket.cpp ../include/aopacket.h ../src/aopacket.cpp) +target_include_directories(test PRIVATE ../include) +target_link_libraries(test PRIVATE Qt5::Widgets Catch2::Catch2) diff --git a/test/test_aopacket.cpp b/test/test_aopacket.cpp new file mode 100644 index 00000000..a5aeb437 --- /dev/null +++ b/test/test_aopacket.cpp @@ -0,0 +1,47 @@ +#define CATCH_CONFIG_MAIN +#include + +#include "aopacket.h" + +TEST_CASE("AOPacket construct", "[aopacket]") { + // Parameters + QString packet_string = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d/123/edit##%"; + QString header = "CT"; + QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/123/edit#"}; + + // Packet string only + AOPacket p(packet_string); + REQUIRE(p.to_string() == packet_string); + + // Header and Contents Separate + AOPacket p2(header, contents); + REQUIRE(p2.to_string() == packet_string); +} + +TEST_CASE("AOPacket encode/decode", "[aopacket]") { + // Parameters + QString packet_string = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d/%$&/edit##%"; + QString header = "CT"; + QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/%$&/edit#"}; + + // Encodes that get "sent" to the server + QString bad_send = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d//edit##%"; + QString good_send = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d//edit#%"; + + // Bad encode/decode for docs because the split on '#' after "edit" in the doc url + AOPacket p(packet_string); + p.net_encode(); + REQUIRE(p.to_string() == bad_send); + + p.net_decode(); + REQUIRE(p.to_string() == packet_string); + + // Good encode/decode for docs because header and contents are separate + AOPacket p2(header, contents); + + p2.net_encode(); + REQUIRE(p2.to_string() == good_send); + + p2.net_decode(); + REQUIRE(p2.to_string() == packet_string); +} -- cgit From ac9dfe32c080823c5f9d0be0efd31b2ad90ecfeb Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:21:55 -0600 Subject: Enable build through CMakeLists --- CMakeLists.txt | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- README_TEST.md | 2 +- 2 files changed, 95 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 322c90c5..97e09e4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ +# Configure cmake cmake_minimum_required(VERSION 3.1.0) -project(ao) +project(AttorneyOnline) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -13,4 +14,96 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0") set(CMAKE_INCLUDE_CURRENT_DIR ON) endif() +# AO +add_executable(Attorney_Online +# resources +resources.qrc + +# src +src/aoapplication.cpp +src/aoblipplayer.cpp +src/aobutton.cpp +src/aocaseannouncerdialog.cpp +src/aocharbutton.cpp +src/aocharmovie.cpp +src/aoemotebutton.cpp +src/aoevidencebutton.cpp +src/aoevidencedisplay.cpp +src/aoimage.cpp +src/aolineedit.cpp +src/aomovie.cpp +src/aomusicplayer.cpp +src/aooptionsdialog.cpp +src/aopacket.cpp +src/aoscene.cpp +src/aosfxplayer.cpp +src/aotextarea.cpp +src/aotextedit.cpp +src/charselect.cpp +src/chatlogpiece.cpp +src/courtroom.cpp +src/debug_functions.cpp +src/discord_rich_presence.cpp +src/emotes.cpp +src/evidence.cpp +src/file_functions.cpp +src/hardware_functions.cpp +src/lobby.cpp +src/main.cpp +src/misc_functions.cpp +src/networkmanager.cpp +src/packet_distribution.cpp +src/path_functions.cpp +src/scrolltext.cpp +src/text_file_functions.cpp + +# include +include/aoapplication.h +include/aoblipplayer.h +include/aobutton.h +include/aocaseannouncerdialog.h +include/aocharbutton.h +include/aocharmovie.h +include/aoemotebutton.h +include/aoevidencebutton.h +include/aoevidencedisplay.h +include/aoimage.h +include/aolineedit.h +include/aomovie.h +include/aomusicplayer.h +include/aooptionsdialog.h +include/aopacket.h +include/aoscene.h +include/aosfxplayer.h +include/aotextarea.h +include/aotextedit.h +include/bass.h +include/bassopus.h +include/chatlogpiece.h +include/courtroom.h +include/datatypes.h +include/debug_functions.h +include/discord-rpc.h +include/discord_register.h +include/discord_rich_presence.h +include/discord_rpc.h +include/file_functions.h +include/hardware_functions.h +include/lobby.h +include/misc_functions.h +include/networkmanager.h +include/scrolltext.h +include/text_file_functions.h +) + +# Target Include +target_include_directories(Attorney_Online PRIVATE include) + +# Target Lib +find_package(Qt5 COMPONENTS Core Gui Network Widgets REQUIRED) +target_link_directories(Attorney_Online PRIVATE lib) +target_link_libraries(Attorney_Online PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets + bass bassopus discord-rpc) + +# Tests add_subdirectory(test) diff --git a/README_TEST.md b/README_TEST.md index c426badf..fc182a3f 100644 --- a/README_TEST.md +++ b/README_TEST.md @@ -3,6 +3,6 @@ Running tests requires Catch2 and cmake ```sh mkdir cbuild && cd cbuild cmake .. -make +make test ./test/test ``` -- cgit From fd5387caf839ec6074545bce59fec7598faec57e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:09:04 -0600 Subject: Link a more relevant qt lib --- test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cc02859e..ea163c1a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ -find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) -target_link_libraries(test PRIVATE Qt5::Widgets Catch2::Catch2) +target_link_libraries(test PRIVATE Qt5::Core Catch2::Catch2) -- cgit From 640f12b3c73bb5dcd82b6caa044839b407be3def Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:33:33 -0600 Subject: Use target_sources --- CMakeLists.txt | 86 +++----------------------------------------------- include/CMakeLists.txt | 38 ++++++++++++++++++++++ src/CMakeLists.txt | 38 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 include/CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 97e09e4a..46cf18c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # Configure cmake cmake_minimum_required(VERSION 3.1.0) +cmake_policy(SET CMP0076 NEW) # silence warning project(AttorneyOnline) @@ -15,86 +16,7 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0") endif() # AO -add_executable(Attorney_Online -# resources -resources.qrc - -# src -src/aoapplication.cpp -src/aoblipplayer.cpp -src/aobutton.cpp -src/aocaseannouncerdialog.cpp -src/aocharbutton.cpp -src/aocharmovie.cpp -src/aoemotebutton.cpp -src/aoevidencebutton.cpp -src/aoevidencedisplay.cpp -src/aoimage.cpp -src/aolineedit.cpp -src/aomovie.cpp -src/aomusicplayer.cpp -src/aooptionsdialog.cpp -src/aopacket.cpp -src/aoscene.cpp -src/aosfxplayer.cpp -src/aotextarea.cpp -src/aotextedit.cpp -src/charselect.cpp -src/chatlogpiece.cpp -src/courtroom.cpp -src/debug_functions.cpp -src/discord_rich_presence.cpp -src/emotes.cpp -src/evidence.cpp -src/file_functions.cpp -src/hardware_functions.cpp -src/lobby.cpp -src/main.cpp -src/misc_functions.cpp -src/networkmanager.cpp -src/packet_distribution.cpp -src/path_functions.cpp -src/scrolltext.cpp -src/text_file_functions.cpp - -# include -include/aoapplication.h -include/aoblipplayer.h -include/aobutton.h -include/aocaseannouncerdialog.h -include/aocharbutton.h -include/aocharmovie.h -include/aoemotebutton.h -include/aoevidencebutton.h -include/aoevidencedisplay.h -include/aoimage.h -include/aolineedit.h -include/aomovie.h -include/aomusicplayer.h -include/aooptionsdialog.h -include/aopacket.h -include/aoscene.h -include/aosfxplayer.h -include/aotextarea.h -include/aotextedit.h -include/bass.h -include/bassopus.h -include/chatlogpiece.h -include/courtroom.h -include/datatypes.h -include/debug_functions.h -include/discord-rpc.h -include/discord_register.h -include/discord_rich_presence.h -include/discord_rpc.h -include/file_functions.h -include/hardware_functions.h -include/lobby.h -include/misc_functions.h -include/networkmanager.h -include/scrolltext.h -include/text_file_functions.h -) +add_executable(Attorney_Online resources.qrc) # Target Include target_include_directories(Attorney_Online PRIVATE include) @@ -105,5 +27,7 @@ target_link_directories(Attorney_Online PRIVATE lib) target_link_libraries(Attorney_Online PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets bass bassopus discord-rpc) -# Tests +# Subdirectories add_subdirectory(test) +add_subdirectory(src) +add_subdirectory(include) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..b801d899 --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,38 @@ +target_sources(Attorney_Online PRIVATE +aoapplication.h +aoblipplayer.h +aobutton.h +aocaseannouncerdialog.h +aocharbutton.h +aocharmovie.h +aoemotebutton.h +aoevidencebutton.h +aoevidencedisplay.h +aoimage.h +aolineedit.h +aomovie.h +aomusicplayer.h +aooptionsdialog.h +aopacket.h +aoscene.h +aosfxplayer.h +aotextarea.h +aotextedit.h +bass.h +bassopus.h +chatlogpiece.h +courtroom.h +datatypes.h +debug_functions.h +discord-rpc.h +discord_register.h +discord_rich_presence.h +discord_rpc.h +file_functions.h +hardware_functions.h +lobby.h +misc_functions.h +networkmanager.h +scrolltext.h +text_file_functions.h +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..533580f8 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,38 @@ +target_sources(Attorney_Online PRIVATE +aoapplication.cpp +aoblipplayer.cpp +aobutton.cpp +aocaseannouncerdialog.cpp +aocharbutton.cpp +aocharmovie.cpp +aoemotebutton.cpp +aoevidencebutton.cpp +aoevidencedisplay.cpp +aoimage.cpp +aolineedit.cpp +aomovie.cpp +aomusicplayer.cpp +aooptionsdialog.cpp +aopacket.cpp +aoscene.cpp +aosfxplayer.cpp +aotextarea.cpp +aotextedit.cpp +charselect.cpp +chatlogpiece.cpp +courtroom.cpp +debug_functions.cpp +discord_rich_presence.cpp +emotes.cpp +evidence.cpp +file_functions.cpp +hardware_functions.cpp +lobby.cpp +main.cpp +misc_functions.cpp +networkmanager.cpp +packet_distribution.cpp +path_functions.cpp +scrolltext.cpp +text_file_functions.cpp +) -- cgit From b1090d6e271ae2b04854462c242ef2ce87d74822 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 20:08:27 -0600 Subject: Add test for case loading --- test/CMakeLists.txt | 2 +- test/test_caseloading.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 test/test_caseloading.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ea163c1a..3dd51c71 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Catch2 REQUIRED) -add_executable(test test_aopacket.cpp ../include/aopacket.h ../src/aopacket.cpp) +add_executable(test test_aopacket.cpp test_caseloading.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_libraries(test PRIVATE Qt5::Core Catch2::Catch2) diff --git a/test/test_caseloading.cpp b/test/test_caseloading.cpp new file mode 100644 index 00000000..5df27823 --- /dev/null +++ b/test/test_caseloading.cpp @@ -0,0 +1,18 @@ +#include + +#include + +TEST_CASE("Sort case evidence numerically", "[case]") { + // Parameters + QStringList case_evidence = {"1", "10", "11", "2", "3", "4", "5", "6", "7", "8", "9"}; + QStringList case_evidence_sorted = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}; + + // Sort + std::sort(case_evidence.begin(), case_evidence.end(), + [] (const QString &a, const QString &b) { + return a.toInt() < b.toInt(); + }); + + // Test + REQUIRE(case_evidence == case_evidence_sorted); +} -- cgit From 337b056400955c9384accf4bb4f3a58a768852cf Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 23:57:43 -0600 Subject: Add test for apng --- test/CMakeLists.txt | 6 +++--- test/test_apng.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/test_apng.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3dd51c71..31aab1e9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ -find_package(Qt5 COMPONENTS Core REQUIRED) +find_package(Qt5 COMPONENTS Core Gui REQUIRED) find_package(Catch2 REQUIRED) -add_executable(test test_aopacket.cpp test_caseloading.cpp ../include/aopacket.h ../src/aopacket.cpp) +add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) -target_link_libraries(test PRIVATE Qt5::Core Catch2::Catch2) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2) diff --git a/test/test_apng.cpp b/test/test_apng.cpp new file mode 100644 index 00000000..c1c04814 --- /dev/null +++ b/test/test_apng.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include + +TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { + QCoreApplication::addLibraryPath("."); + QPluginLoader apngPlugin("qapng"); + REQUIRE(apngPlugin.load()); + + // Fails for some reason on windows and linux don't know about osx + // apng animation seems to be broken linux qt5-5.15.2 + REQUIRE(QImageReader::supportedImageFormats().contains("APNG")); +} -- cgit From 1fc6c855684ad6ef00f5ff3d646df043363ee100 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 12:15:19 -0600 Subject: Add test for streaming with BASS --- README_TEST.md | 8 +++++++- test/CMakeLists.txt | 5 +++-- test/test_bass.cpp | 28 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 test/test_bass.cpp diff --git a/README_TEST.md b/README_TEST.md index fc182a3f..101b12d9 100644 --- a/README_TEST.md +++ b/README_TEST.md @@ -1,8 +1,14 @@ -Running tests requires Catch2 and cmake +Running tests requires Catch2 and cmake. libs are assumed to be in +the same directory as the executable ```sh mkdir cbuild && cd cbuild cmake .. make test + +# usage: run all tests ./test/test + +# usage: Optionally specify tests and success verbosity +./test/test [bass] --success ``` diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 31aab1e9..4249f1b3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,7 @@ find_package(Qt5 COMPONENTS Core Gui REQUIRED) find_package(Catch2 REQUIRED) -add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp ../include/aopacket.h ../src/aopacket.cpp) +add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2) +target_link_directories(test PRIVATE ../lib) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass) diff --git a/test/test_bass.cpp b/test/test_bass.cpp new file mode 100644 index 00000000..0709fb92 --- /dev/null +++ b/test/test_bass.cpp @@ -0,0 +1,28 @@ +#include +#include + +#include +#include + +#include "bass.h" + +TEST_CASE("BASS URL streaming", "[bass]") { + // Sample + QString url = "https://raw.githubusercontent.com/skyedeving/aocharedit/master/Attorney%20Online%20Character%20Editor/Resources/about.mp3"; + BASS_Init(-1, 44100, 0, 0, nullptr); +#ifdef _WIN32 + HSTREAM stream = BASS_StreamCreateURL(url.toWStdString().c_str(), 0, BASS_STREAM_STATUS, nullptr, 0); +#else + HSTREAM stream = BASS_StreamCreateURL(url.toStdString().c_str(), 0, BASS_STREAM_STATUS, nullptr, 0); +#endif + const char *tags = BASS_ChannelGetTags(stream, BASS_TAG_HTTP); + if (tags) { + while(*tags) { + UNSCOPED_INFO(tags); + tags += strlen(tags) + 1; + } + } + REQUIRE(stream != 0); + REQUIRE(BASS_ChannelPlay(stream, TRUE) == TRUE); + // while (BASS_ChannelIsActive(stream) != BASS_ACTIVE_STOPPED); +} -- cgit From ba47b5d35e90f0e4a5ea55d00dbe82acba65fb56 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 12:46:40 -0600 Subject: Update bass streaming test to include opus as well --- test/CMakeLists.txt | 2 +- test/test_bass.cpp | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4249f1b3..840eabc1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,4 +4,4 @@ find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus) diff --git a/test/test_bass.cpp b/test/test_bass.cpp index 0709fb92..24357492 100644 --- a/test/test_bass.cpp +++ b/test/test_bass.cpp @@ -5,16 +5,26 @@ #include #include "bass.h" +#include "bassopus.h" TEST_CASE("BASS URL streaming", "[bass]") { // Sample QString url = "https://raw.githubusercontent.com/skyedeving/aocharedit/master/Attorney%20Online%20Character%20Editor/Resources/about.mp3"; + + // initialize BASS_Init(-1, 44100, 0, 0, nullptr); -#ifdef _WIN32 - HSTREAM stream = BASS_StreamCreateURL(url.toWStdString().c_str(), 0, BASS_STREAM_STATUS, nullptr, 0); -#else - HSTREAM stream = BASS_StreamCreateURL(url.toStdString().c_str(), 0, BASS_STREAM_STATUS, nullptr, 0); -#endif + + // create stream from url + HSTREAM stream; + unsigned int flags = BASS_STREAM_AUTOFREE | BASS_STREAM_STATUS; + if (url.endsWith(".opus")) { + stream = BASS_OPUS_StreamCreateURL(url.toStdString().c_str(), 0, flags, nullptr, 0); + } + else { + stream = BASS_StreamCreateURL(url.toStdString().c_str(), 0, flags, nullptr, 0); + } + + // Log http status const char *tags = BASS_ChannelGetTags(stream, BASS_TAG_HTTP); if (tags) { while(*tags) { @@ -22,7 +32,9 @@ TEST_CASE("BASS URL streaming", "[bass]") { tags += strlen(tags) + 1; } } + + // Test REQUIRE(stream != 0); REQUIRE(BASS_ChannelPlay(stream, TRUE) == TRUE); - // while (BASS_ChannelIsActive(stream) != BASS_ACTIVE_STOPPED); + // while (BASS_ChannelIsActive(stream) != BASS_ACTIVE_STOPPED); // block test to listen } -- cgit From 9c4f8dfc97dc106b054191399bd5f320c111b179 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 19:30:22 -0600 Subject: Create cmake.yml to run tests on github actions --- .github/workflows/cmake.yml | 77 +++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..da2ae56f --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,77 @@ +name: CMake + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Install catch2 + run: | + curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz + tar xvf catch2.tar.gz + cd Catch2-2.13.4 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + + - name: Fetch external libs + run: | + # Download + curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip + curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip + curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip + curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.0-5/build_gcc_64_5.12.0.tar.xz -o apng.tar.xz + # Extract + unzip bass_linux.zip + unzip bassopus_linux.zip + unzip discord_rpc_linux.zip + tar -xvf apng.tar.xz + # Copy + cp x64/libbass.so lib + cp x64/libbassopus.so lib + cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib + cp gcc_64/plugins/imageformats/libqapng.so lib + + - name: Install Qt5 + run: sudo apt update -y && sudo apt install -y qt5-default + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE --target test + + - name: Copy libs to test directory + run: cp ${{github.workspace}}/lib/* ${{github.workspace}}/build/test/ + + - name: Test + working-directory: ${{github.workspace}}/build/test + shell: bash + # Skipping tests for bass since no audio device + run: | + ./test ~[bass] diff --git a/CMakeLists.txt b/CMakeLists.txt index 46cf18c5..22ff49d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0076 NEW) # silence warning project(AttorneyOnline) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) -- cgit From 7a1d6743e1b1c59d7315914f72f523509808ad1f Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 22:51:15 -0600 Subject: Refactor aopacket tests --- test/test_aopacket.cpp | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/test/test_aopacket.cpp b/test/test_aopacket.cpp index a5aeb437..b289f85a 100644 --- a/test/test_aopacket.cpp +++ b/test/test_aopacket.cpp @@ -6,42 +6,38 @@ TEST_CASE("AOPacket construct", "[aopacket]") { // Parameters QString packet_string = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d/123/edit##%"; - QString header = "CT"; - QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/123/edit#"}; - // Packet string only - AOPacket p(packet_string); - REQUIRE(p.to_string() == packet_string); - - // Header and Contents Separate - AOPacket p2(header, contents); - REQUIRE(p2.to_string() == packet_string); + SECTION("Packet string") { + AOPacket p(packet_string); + REQUIRE(p.to_string() == packet_string); + } + SECTION("Header and contents") { + AOPacket p("CT", {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/123/edit#"}); + REQUIRE(p.to_string() == packet_string); + } } TEST_CASE("AOPacket encode/decode", "[aopacket]") { // Parameters QString packet_string = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d/%$&/edit##%"; - QString header = "CT"; - QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/%$&/edit#"}; - - // Encodes that get "sent" to the server - QString bad_send = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d//edit##%"; - QString good_send = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d//edit#%"; + QString good_encode = "CT#MY_OOC_NAME#/doc https://docs.google.com/document/d//edit#%"; - // Bad encode/decode for docs because the split on '#' after "edit" in the doc url - AOPacket p(packet_string); - p.net_encode(); - REQUIRE(p.to_string() == bad_send); + SECTION("Bad encode/decode because packet string constructor splits the '#' after 'edit'") { + AOPacket p(packet_string); + p.net_encode(); + REQUIRE(p.to_string() != good_encode); - p.net_decode(); - REQUIRE(p.to_string() == packet_string); + p.net_decode(); + REQUIRE(p.to_string() == packet_string); + } - // Good encode/decode for docs because header and contents are separate - AOPacket p2(header, contents); + SECTION("Good encode/decode with header and contents constructor") { + AOPacket p("CT", {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/%$&/edit#"}); - p2.net_encode(); - REQUIRE(p2.to_string() == good_send); + p.net_encode(); + REQUIRE(p.to_string() == good_encode); - p2.net_decode(); - REQUIRE(p2.to_string() == packet_string); + p.net_decode(); + REQUIRE(p.to_string() == packet_string); + } } -- cgit From f1d12d17a06ad00f8e092bc47b4ef675ff4303ad Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:02:12 -0600 Subject: Fix compile error Forgot about passing rvalues --- test/test_aopacket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_aopacket.cpp b/test/test_aopacket.cpp index b289f85a..0b318213 100644 --- a/test/test_aopacket.cpp +++ b/test/test_aopacket.cpp @@ -12,7 +12,8 @@ TEST_CASE("AOPacket construct", "[aopacket]") { REQUIRE(p.to_string() == packet_string); } SECTION("Header and contents") { - AOPacket p("CT", {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/123/edit#"}); + QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/123/edit#"}; + AOPacket p("CT", contents); REQUIRE(p.to_string() == packet_string); } } @@ -32,7 +33,8 @@ TEST_CASE("AOPacket encode/decode", "[aopacket]") { } SECTION("Good encode/decode with header and contents constructor") { - AOPacket p("CT", {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/%$&/edit#"}); + QStringList contents = {"MY_OOC_NAME", "/doc https://docs.google.com/document/d/%$&/edit#"}; + AOPacket p("CT", contents); p.net_encode(); REQUIRE(p.to_string() == good_encode); -- cgit From 341c658cde9808eedb789981b51fa89edb71e4cd Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:09:46 -0600 Subject: Test for both apng and APNG in supported image formats --- test/test_apng.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index c1c04814..9c15e3cf 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -11,5 +11,6 @@ TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { // Fails for some reason on windows and linux don't know about osx // apng animation seems to be broken linux qt5-5.15.2 - REQUIRE(QImageReader::supportedImageFormats().contains("APNG")); + REQUIRE((QImageReader::supportedImageFormats().contains("apng") || + QImageReader::supportedImageFormats().contains("APNG"))); } -- cgit From b3dd00270e6d644864ced766a0f1ec2bb3a89a78 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:21:37 -0600 Subject: Add info to failing test case --- test/test_apng.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 9c15e3cf..026826b1 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -11,6 +11,7 @@ TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { // Fails for some reason on windows and linux don't know about osx // apng animation seems to be broken linux qt5-5.15.2 + INFO(QImageReader::supportedImageFormats().join(' ').toStdString()); REQUIRE((QImageReader::supportedImageFormats().contains("apng") || QImageReader::supportedImageFormats().contains("APNG"))); } -- cgit From be0fa26e85de1edaa5c7e0e68d62d9f59f854753 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 00:43:30 -0600 Subject: Test seems to work if linking QtApng installed on system --- test/CMakeLists.txt | 2 +- test/test_apng.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 840eabc1..e09e48e3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,4 +4,4 @@ find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus qapng) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 026826b1..7d7062bc 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -4,14 +4,15 @@ #include #include -TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { +TEST_CASE("Support APNG Plugin", "[apng]") { + // Check paths for libs QCoreApplication::addLibraryPath("."); + QCoreApplication::addLibraryPath("lib"); + + // Either it's loaded from system or we load local QPluginLoader apngPlugin("qapng"); - REQUIRE(apngPlugin.load()); + apngPlugin.load(); - // Fails for some reason on windows and linux don't know about osx - // apng animation seems to be broken linux qt5-5.15.2 INFO(QImageReader::supportedImageFormats().join(' ').toStdString()); - REQUIRE((QImageReader::supportedImageFormats().contains("apng") || - QImageReader::supportedImageFormats().contains("APNG"))); + REQUIRE(QImageReader::supportedImageFormats().contains("apng")); } -- cgit From 8da71b651037c3572a1c799341af964636b9acbb Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 00:48:39 -0600 Subject: Install QtApng dependency --- .github/workflows/cmake.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index da2ae56f..5f3d362f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -45,6 +45,13 @@ jobs: - name: Install Qt5 run: sudo apt update -y && sudo apt install -y qt5-default + - name: Install QtApng + run: | + git clone https://github.com/Skycoder42/QtApng + cd QtApng + qmake + sudo make install + - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands -- cgit From 70cf57a8700a21862b141935e2c2a12907d59924 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 00:48:57 -0600 Subject: Link against qapng --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22ff49d7..963151ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ target_include_directories(Attorney_Online PRIVATE include) find_package(Qt5 COMPONENTS Core Gui Network Widgets REQUIRED) target_link_directories(Attorney_Online PRIVATE lib) target_link_libraries(Attorney_Online PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets - bass bassopus discord-rpc) + bass bassopus qapng discord-rpc) # Subdirectories add_subdirectory(test) -- cgit From 7b7da4e391ef72e3b35a0df417a558979fe9636c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 00:55:51 -0600 Subject: Try fix build --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5f3d362f..48451ab0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -50,6 +50,7 @@ jobs: git clone https://github.com/Skycoder42/QtApng cd QtApng qmake + make sudo make install - name: Create Build Environment -- cgit From cf0a18a51376a49eb6c08aefc14fcf6ba5e2edd1 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:31:34 -0600 Subject: Check if this is not required now --- .github/workflows/cmake.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 48451ab0..8cf17992 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -30,17 +30,14 @@ jobs: curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip - curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.0-5/build_gcc_64_5.12.0.tar.xz -o apng.tar.xz # Extract unzip bass_linux.zip unzip bassopus_linux.zip unzip discord_rpc_linux.zip - tar -xvf apng.tar.xz # Copy cp x64/libbass.so lib cp x64/libbassopus.so lib cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib - cp gcc_64/plugins/imageformats/libqapng.so lib - name: Install Qt5 run: sudo apt update -y && sudo apt install -y qt5-default -- cgit From 26887eff32640ccb5bcf1d0e042dee31b4e7aa9a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:35:13 -0600 Subject: Check if the explicit linking is unnecessary --- CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 963151ed..22ff49d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ target_include_directories(Attorney_Online PRIVATE include) find_package(Qt5 COMPONENTS Core Gui Network Widgets REQUIRED) target_link_directories(Attorney_Online PRIVATE lib) target_link_libraries(Attorney_Online PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets - bass bassopus qapng discord-rpc) + bass bassopus discord-rpc) # Subdirectories add_subdirectory(test) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e09e48e3..840eabc1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,4 +4,4 @@ find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus qapng) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus) -- cgit From 0064eb692f2f544ffba47cc4323c23341196605e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:38:27 -0600 Subject: Check if copying libs over is unnecessary --- .github/workflows/cmake.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8cf17992..adff7bc9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,12 +71,8 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE --target test - - name: Copy libs to test directory - run: cp ${{github.workspace}}/lib/* ${{github.workspace}}/build/test/ - - name: Test working-directory: ${{github.workspace}}/build/test shell: bash # Skipping tests for bass since no audio device - run: | - ./test ~[bass] + run: ./test ~[bass] -- cgit From f5110f758e8f8258ed0857a7ad73f072898719b4 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:43:43 -0600 Subject: Add DISCORD compile definition --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22ff49d7..77347f28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ find_package(Qt5 COMPONENTS Core Gui Network Widgets REQUIRED) target_link_directories(Attorney_Online PRIVATE lib) target_link_libraries(Attorney_Online PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets bass bassopus discord-rpc) +target_compile_definitions(Attorney_Online PRIVATE DISCORD) # Subdirectories add_subdirectory(test) -- cgit From bd5ed84c1678877e7500558f0e455bed4d653766 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 01:46:34 -0600 Subject: Add DISCORD compile definition to tests too --- test/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 840eabc1..aa26ae4c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,4 +4,5 @@ find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus discord-rpc) +target_compile_definitions(Attorney_Online PRIVATE DISCORD) -- cgit From a8fdea09b046a7c9c4fbb00d878fbb693abecdde Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:15:45 -0600 Subject: Add test for detecting png animation --- test/CMakeLists.txt | 4 ++-- test/test_apng.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aa26ae4c..e43b5517 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,8 @@ -find_package(Qt5 COMPONENTS Core Gui REQUIRED) +find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus discord-rpc) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Catch2::Catch2 bass bassopus discord-rpc) target_compile_definitions(Attorney_Online PRIVATE DISCORD) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 7d7062bc..cbeb68a7 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include TEST_CASE("Support APNG Plugin", "[apng]") { // Check paths for libs @@ -16,3 +18,22 @@ TEST_CASE("Support APNG Plugin", "[apng]") { INFO(QImageReader::supportedImageFormats().join(' ').toStdString()); REQUIRE(QImageReader::supportedImageFormats().contains("apng")); } + +TEST_CASE("Detect png animation", "[apng]") { + // Required for QPixmap methods + int argc = 1; + char bin[] = "test"; + char *argv[] = { bin }; + QApplication app(argc, argv); + + // Detect apng supports animation + QImageReader a("snackoo.png", "apng"); + REQUIRE(a.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(a.read()).isNull()); + + // Detect png frame has no animation + QImageReader p("snackoo-frame.png", "apng"); + REQUIRE(!p.supportsAnimation()); + p.setFormat("png"); + REQUIRE(!QPixmap::fromImage(p.read()).isNull()); +} -- cgit From 608d6dff61ba55fb29e21fde5e1d2b6b63479901 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:22:23 -0600 Subject: Try to fix CI --- test/test_apng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index cbeb68a7..c15bebb0 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include TEST_CASE("Support APNG Plugin", "[apng]") { @@ -24,7 +24,7 @@ TEST_CASE("Detect png animation", "[apng]") { int argc = 1; char bin[] = "test"; char *argv[] = { bin }; - QApplication app(argc, argv); + QGuiApplication app(argc, argv); // Detect apng supports animation QImageReader a("snackoo.png", "apng"); -- cgit From ed7863f2fce7c629ee79ab13df302acbf8ac0a3a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:28:07 -0600 Subject: Add env variable to indicate no screen --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index adff7bc9..5573453a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,4 +75,4 @@ jobs: working-directory: ${{github.workspace}}/build/test shell: bash # Skipping tests for bass since no audio device - run: ./test ~[bass] + run: QT_QPA_PLATFORM=offscreen ./test ~[bass] -- cgit From 6e679056b52abc9f48f0cfc9129b2bd708515b69 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:39:02 -0600 Subject: Add tag for not running test in ci --- test/test_apng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index c15bebb0..fdfb8ddb 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -19,7 +19,7 @@ TEST_CASE("Support APNG Plugin", "[apng]") { REQUIRE(QImageReader::supportedImageFormats().contains("apng")); } -TEST_CASE("Detect png animation", "[apng]") { +TEST_CASE("Detect png animation", "[apng][noci]") { // Required for QPixmap methods int argc = 1; char bin[] = "test"; -- cgit From 9363246ca1b03a23f7fa99a02f8adcc347d18e8c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:40:41 -0600 Subject: Ignore tests with noci tag --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5573453a..408e32af 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,4 +75,4 @@ jobs: working-directory: ${{github.workspace}}/build/test shell: bash # Skipping tests for bass since no audio device - run: QT_QPA_PLATFORM=offscreen ./test ~[bass] + run: QT_QPA_PLATFORM=offscreen ./test ~[bass] ~[noci] -- cgit From 517ebdf2479647cd7c42166ec0c292d86ec3aace Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 03:57:04 -0600 Subject: Add test case for auto detect of apng from png failing --- test/test_apng.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index fdfb8ddb..180465a1 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -36,4 +36,11 @@ TEST_CASE("Detect png animation", "[apng][noci]") { REQUIRE(!p.supportsAnimation()); p.setFormat("png"); REQUIRE(!QPixmap::fromImage(p.read()).isNull()); + + // Auto detect fails + QImageReader d; + d.setAutoDetectImageFormat(true); + d.setFileName("snackoo.png"); + REQUIRE(!d.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(d.read()).isNull()); } -- cgit From c7f86707949b654a50bc8e6240e665d53ec2a056 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:03:51 -0600 Subject: Add test case for apng failed to detect from content --- test/test_apng.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 180465a1..50965ad5 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -37,10 +37,17 @@ TEST_CASE("Detect png animation", "[apng][noci]") { p.setFormat("png"); REQUIRE(!QPixmap::fromImage(p.read()).isNull()); - // Auto detect fails + // Auto detect fails on apng QImageReader d; - d.setAutoDetectImageFormat(true); + d.setDecideFormatFromContent(true); d.setFileName("snackoo.png"); REQUIRE(!d.supportsAnimation()); REQUIRE(!QPixmap::fromImage(d.read()).isNull()); + + // Decide format fom content fails on apng + QImageReader c; + c.setDecideFormatFromContent(true); + c.setFileName("snackoo.png"); + REQUIRE(!c.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(c.read()).isNull()); } -- cgit From 29354d919fad2da8c26054abb796ed7a270f278d Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:05:25 -0600 Subject: Undo accidentally overwrite --- test/test_apng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 50965ad5..403034bb 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -39,7 +39,7 @@ TEST_CASE("Detect png animation", "[apng][noci]") { // Auto detect fails on apng QImageReader d; - d.setDecideFormatFromContent(true); + d.setAutoDetectImageFormat(true); d.setFileName("snackoo.png"); REQUIRE(!d.supportsAnimation()); REQUIRE(!QPixmap::fromImage(d.read()).isNull()); -- cgit From 760d5861604b63b088943552fb70863952fa060e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:22:18 -0600 Subject: Refactor the test for detecting apng from png --- test/test_apng.cpp | 56 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 403034bb..93550b53 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -26,28 +26,36 @@ TEST_CASE("Detect png animation", "[apng][noci]") { char *argv[] = { bin }; QGuiApplication app(argc, argv); - // Detect apng supports animation - QImageReader a("snackoo.png", "apng"); - REQUIRE(a.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(a.read()).isNull()); - - // Detect png frame has no animation - QImageReader p("snackoo-frame.png", "apng"); - REQUIRE(!p.supportsAnimation()); - p.setFormat("png"); - REQUIRE(!QPixmap::fromImage(p.read()).isNull()); - - // Auto detect fails on apng - QImageReader d; - d.setAutoDetectImageFormat(true); - d.setFileName("snackoo.png"); - REQUIRE(!d.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(d.read()).isNull()); - - // Decide format fom content fails on apng - QImageReader c; - c.setDecideFormatFromContent(true); - c.setFileName("snackoo.png"); - REQUIRE(!c.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(c.read()).isNull()); + // Instantiate reader + QImageReader reader; + + SECTION("Decide format from content fails on apng") { + reader.setFileName("snackoo.png"); + reader.setDecideFormatFromContent(true); + REQUIRE(!reader.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); + } + + SECTION("Auto detect fails on apng") { + reader.setFileName("snackoo.png"); + reader.setAutoDetectImageFormat(true); + REQUIRE(!reader.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); + } + + SECTION("Detect apng supports animation") { + reader.setFileName("snackoo.png"); + reader.setFormat("apng"); + REQUIRE(reader.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); + } + + SECTION("Detect png frame has no animation") { + reader.setFileName("snackoo-frame.png"); + reader.setFormat("apng"); + REQUIRE(!reader.supportsAnimation()); + reader.setFormat("png"); + REQUIRE(!reader.supportsAnimation()); + REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); + } } -- cgit From cbdeea00109fa8b7bd052653938ac106514c1133 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:29:49 -0600 Subject: Add test resources in and enable tests --- .github/workflows/cmake.yml | 4 +++- test/missle.png | Bin 0 -> 55423 bytes test/snackoo.png | Bin 0 -> 92034 bytes test/test_apng.cpp | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test/missle.png create mode 100644 test/snackoo.png diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 408e32af..340bc7ea 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,4 +75,6 @@ jobs: working-directory: ${{github.workspace}}/build/test shell: bash # Skipping tests for bass since no audio device - run: QT_QPA_PLATFORM=offscreen ./test ~[bass] ~[noci] + run: | + ln -s ../../test/*.png . + QT_QPA_PLATFORM=offscreen ./test ~[bass] ~[noci] diff --git a/test/missle.png b/test/missle.png new file mode 100644 index 00000000..6f373b45 Binary files /dev/null and b/test/missle.png differ diff --git a/test/snackoo.png b/test/snackoo.png new file mode 100644 index 00000000..31577a31 Binary files /dev/null and b/test/snackoo.png differ diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 93550b53..20c7e927 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -19,7 +19,7 @@ TEST_CASE("Support APNG Plugin", "[apng]") { REQUIRE(QImageReader::supportedImageFormats().contains("apng")); } -TEST_CASE("Detect png animation", "[apng][noci]") { +TEST_CASE("Detect png animation", "[apng]") { // Required for QPixmap methods int argc = 1; char bin[] = "test"; @@ -51,7 +51,7 @@ TEST_CASE("Detect png animation", "[apng][noci]") { } SECTION("Detect png frame has no animation") { - reader.setFileName("snackoo-frame.png"); + reader.setFileName("missle.png"); reader.setFormat("apng"); REQUIRE(!reader.supportsAnimation()); reader.setFormat("png"); -- cgit From 75dd544e5d4e359e19c904936c3bc96e8c9314e3 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:42:37 -0600 Subject: Add a note to readme on the noci tag for disabling test on CI --- README_TEST.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README_TEST.md b/README_TEST.md index 101b12d9..774ad3cb 100644 --- a/README_TEST.md +++ b/README_TEST.md @@ -1,6 +1,6 @@ -Running tests requires Catch2 and cmake. libs are assumed to be in -the same directory as the executable +Running tests requires Catch2 and cmake +# Running Tests ```sh mkdir cbuild && cd cbuild cmake .. @@ -12,3 +12,6 @@ make test # usage: Optionally specify tests and success verbosity ./test/test [bass] --success ``` + +# Writing Tests +`[noci]` tag is used to disable a test on Github actions -- cgit From d73acf4d0d138efa7e85ed45c2f2df3ef2b99d96 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 7 Jan 2021 04:44:10 -0600 Subject: Use noci tag for disabling bass test --- .github/workflows/cmake.yml | 3 +-- test/test_bass.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 340bc7ea..d28b9b0a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -74,7 +74,6 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build/test shell: bash - # Skipping tests for bass since no audio device run: | ln -s ../../test/*.png . - QT_QPA_PLATFORM=offscreen ./test ~[bass] ~[noci] + QT_QPA_PLATFORM=offscreen ./test ~[noci] diff --git a/test/test_bass.cpp b/test/test_bass.cpp index 24357492..f5f9198d 100644 --- a/test/test_bass.cpp +++ b/test/test_bass.cpp @@ -7,7 +7,7 @@ #include "bass.h" #include "bassopus.h" -TEST_CASE("BASS URL streaming", "[bass]") { +TEST_CASE("BASS URL streaming", "[bass][noci]") { // Sample QString url = "https://raw.githubusercontent.com/skyedeving/aocharedit/master/Attorney%20Online%20Character%20Editor/Resources/about.mp3"; -- cgit From 32cf9e11b7335de3f04f97f0cd5b1c0e0f21fb4c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 11:45:53 -0600 Subject: Build with C++20 --- .github/workflows/cmake.yml | 3 +++ CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d28b9b0a..785c5efc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -59,6 +59,9 @@ jobs: # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash + env: + CC: gcc-10 + CXX: g++-10 working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. diff --git a/CMakeLists.txt b/CMakeLists.txt index 77347f28..495f9731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0076 NEW) # silence warning project(AttorneyOnline) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) -- cgit From 76e15de6e882a1dcb67271e4f1c3f8db751d9c7e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:02:59 -0600 Subject: Rename workflows and start testing one for builds --- .github/workflows/build.yml | 80 +++++++++++++++++++++++++++++++++++++++++++ .github/workflows/cmake.yml | 82 --------------------------------------------- .github/workflows/test.yml | 82 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/cmake.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..82eaad68 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,80 @@ +name: build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Fetch external libs + run: | + # Download + curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip + curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip + curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip + # Extract + unzip bass_linux.zip + unzip bassopus_linux.zip + unzip discord_rpc_linux.zip + # Copy + cp x64/libbass.so lib + cp x64/libbassopus.so lib + cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib + + - name: Install Qt5 + run: sudo apt update -y && sudo apt install -y qt5-default + + - name: Install QtApng + run: | + git clone https://github.com/Skycoder42/QtApng + cd QtApng + qmake + make + sudo make install + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + env: + CC: gcc-10 + CXX: g++-10 + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE Attorney_Online + + - name: Strip + working-directory: ${{github.workspace}}/build + shell: bash + run: strip -s Attorney_Online + + - name: Upload Artifact + working-directory: ${{github.workspace}}/build + uses: actions/upload-artifact@v2 + with: + name: Attorney_Online + path: Attorney_Online diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index 785c5efc..00000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: CMake - -on: [push] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - name: Install catch2 - run: | - curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz - tar xvf catch2.tar.gz - cd Catch2-2.13.4 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install - - - name: Fetch external libs - run: | - # Download - curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip - curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip - curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip - # Extract - unzip bass_linux.zip - unzip bassopus_linux.zip - unzip discord_rpc_linux.zip - # Copy - cp x64/libbass.so lib - cp x64/libbassopus.so lib - cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib - - - name: Install Qt5 - run: sudo apt update -y && sudo apt install -y qt5-default - - - name: Install QtApng - run: | - git clone https://github.com/Skycoder42/QtApng - cd QtApng - qmake - make - sudo make install - - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - # Use a bash shell so we can use the same syntax for environment variable - # access regardless of the host operating system - shell: bash - env: - CC: gcc-10 - CXX: g++-10 - working-directory: ${{github.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE --target test - - - name: Test - working-directory: ${{github.workspace}}/build/test - shell: bash - run: | - ln -s ../../test/*.png . - QT_QPA_PLATFORM=offscreen ./test ~[noci] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..dadaa23c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,82 @@ +name: test + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Install catch2 + run: | + curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz + tar xvf catch2.tar.gz + cd Catch2-2.13.4 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + + - name: Fetch external libs + run: | + # Download + curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip + curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip + curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip + # Extract + unzip bass_linux.zip + unzip bassopus_linux.zip + unzip discord_rpc_linux.zip + # Copy + cp x64/libbass.so lib + cp x64/libbassopus.so lib + cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib + + - name: Install Qt5 + run: sudo apt update -y && sudo apt install -y qt5-default + + - name: Install QtApng + run: | + git clone https://github.com/Skycoder42/QtApng + cd QtApng + qmake + make + sudo make install + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + env: + CC: gcc-10 + CXX: g++-10 + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE --target test + + - name: Test + working-directory: ${{github.workspace}}/build/test + shell: bash + run: | + ln -s ../../test/*.png . + QT_QPA_PLATFORM=offscreen ./test ~[noci] -- cgit From f84952d6ae95e52b40b61a271ab259c4b9df8a9e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:06:33 -0600 Subject: Fix the workflow startup error maybe --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82eaad68..a5832041 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,8 +73,7 @@ jobs: run: strip -s Attorney_Online - name: Upload Artifact - working-directory: ${{github.workspace}}/build uses: actions/upload-artifact@v2 with: name: Attorney_Online - path: Attorney_Online + path: ${{github.workspace}}/build/Attorney_Online -- cgit From 7055e7dbc06ad23195ad0056ae87b2786d446dc2 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:09:08 -0600 Subject: Add the Catch2 install to workflow --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5832041..471d4b81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,14 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install catch2 + run: | + curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz + tar xvf catch2.tar.gz + cd Catch2-2.13.4 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + - name: Fetch external libs run: | # Download -- cgit From 8b817ac3f680f6a5484becfcf4fe36bc91fe4727 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:11:04 -0600 Subject: Add target command lne option --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 471d4b81..e0972b6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE Attorney_Online + run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - name: Strip working-directory: ${{github.workspace}}/build -- cgit From b9e6918b219c67bf21429305bdf5a49e007d3156 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:17:36 -0600 Subject: Build Attorney Online artifact only when push to master --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0972b6f..921b0d0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: build -on: [push] +on: + push: + branches: + - master env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -- cgit From daa3e173fa7e1fe5885071f6461db280b387e4e0 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:22:46 -0600 Subject: Compress binary --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 921b0d0b..e19e0cfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,8 +83,13 @@ jobs: shell: bash run: strip -s Attorney_Online + - name: Compress + working-directory: ${{github.workspace}}/build + shell: bash + run: tar czvf Attorney_Online-linux-x86_64.tgz Attorney_Online + - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: Attorney_Online - path: ${{github.workspace}}/build/Attorney_Online + path: ${{github.workspace}}/build/Attorney_Online-linux-x86_64.tgz -- cgit From a921b23eade6b3f1f3bb30c554fe6295e878ed07 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sat, 9 Jan 2021 12:32:08 -0600 Subject: Move env var into the action itself --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dadaa23c..6d745e05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,6 +77,8 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build/test shell: bash + env: + QT_QPA_PLATFORM: offscreen run: | ln -s ../../test/*.png . - QT_QPA_PLATFORM=offscreen ./test ~[noci] + ./test ~[noci] -- cgit From 9c86ed7ffe742710d68cf9f587d082396e18aa84 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sun, 10 Jan 2021 12:06:50 -0600 Subject: Trigger tests only on this branch for now --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d745e05..37905ad8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: test -on: [push] +on: + push: + branch: + - test env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -- cgit From fef16a320ad9995f9256184777f8d705f09a61d0 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Sun, 10 Jan 2021 12:47:56 -0600 Subject: Fix branch name --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37905ad8..4350a7c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,8 @@ name: test on: push: - branch: - - test + branches: + - add-tests env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -- cgit From 2d33a52c82c8733377c163161ca84462ec69ea6e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 18:32:11 -0600 Subject: Update the cmakelists to newest --- include/CMakeLists.txt | 6 +++--- src/CMakeLists.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b801d899..18cf23ba 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -4,17 +4,16 @@ aoblipplayer.h aobutton.h aocaseannouncerdialog.h aocharbutton.h -aocharmovie.h +aoclocklabel.h aoemotebutton.h aoevidencebutton.h aoevidencedisplay.h aoimage.h +aolayer.h aolineedit.h -aomovie.h aomusicplayer.h aooptionsdialog.h aopacket.h -aoscene.h aosfxplayer.h aotextarea.h aotextedit.h @@ -24,6 +23,7 @@ chatlogpiece.h courtroom.h datatypes.h debug_functions.h +demoserver.h discord-rpc.h discord_register.h discord_rich_presence.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 533580f8..b04db8b3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,17 +4,16 @@ aoblipplayer.cpp aobutton.cpp aocaseannouncerdialog.cpp aocharbutton.cpp -aocharmovie.cpp +aoclocklabel.cpp aoemotebutton.cpp aoevidencebutton.cpp aoevidencedisplay.cpp aoimage.cpp +aolayer.cpp aolineedit.cpp -aomovie.cpp aomusicplayer.cpp aooptionsdialog.cpp aopacket.cpp -aoscene.cpp aosfxplayer.cpp aotextarea.cpp aotextedit.cpp @@ -22,6 +21,7 @@ charselect.cpp chatlogpiece.cpp courtroom.cpp debug_functions.cpp +demoserver.cpp discord_rich_presence.cpp emotes.cpp evidence.cpp -- cgit From 67214b772d92b6750233ceaee4057e4aa32f574e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 19:19:25 -0600 Subject: Attempt windows build --- .github/workflows/build.yml | 180 ++++++++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 74 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e19e0cfc..aea8c3ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,93 +3,125 @@ name: build on: push: branches: - - master + - add-tests env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-20.04 + windows: + runs-on: windows-latest steps: - uses: actions/checkout@v2 + + - name: actions/cache qt + uses: actions/cache@v1 + id: cache + with: + path: qt/5.15.2/msvc2019_64 + key: qt-5.15.2-msvc2019_64 + + - uses: Skycoder42/action-setup-qt@master + id: qt + with: + version: 5.15.2 + platform: msvc2019_64 + cachedir: qt/5.15.2/msvc2019_64 - - name: Install catch2 - run: | - curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz - tar xvf catch2.tar.gz - cd Catch2-2.13.4 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install - - - name: Fetch external libs - run: | - # Download - curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip - curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip - curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip - # Extract - unzip bass_linux.zip - unzip bassopus_linux.zip - unzip discord_rpc_linux.zip - # Copy - cp x64/libbass.so lib - cp x64/libbassopus.so lib - cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib - - - name: Install Qt5 - run: sudo apt update -y && sudo apt install -y qt5-default - - - name: Install QtApng + - name: qmake run: | - git clone https://github.com/Skycoder42/QtApng - cd QtApng - qmake - make - sudo make install - - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - # Use a bash shell so we can use the same syntax for environment variable - # access regardless of the host operating system - shell: bash - env: - CC: gcc-10 - CXX: g++-10 - working-directory: ${{github.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - - - name: Strip - working-directory: ${{github.workspace}}/build - shell: bash - run: strip -s Attorney_Online - - - name: Compress - working-directory: ${{github.workspace}}/build - shell: bash - run: tar czvf Attorney_Online-linux-x86_64.tgz Attorney_Online + qmake CONFIG+=install_ok QT_PLATFORM=msvc2019_64 + ${{steps.qt.outputs.make}} qmake_all - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: Attorney_Online - path: ${{github.workspace}}/build/Attorney_Online-linux-x86_64.tgz + path: ${{github.workspace}}/bin/Attorney_Online + + + # linux: + # # The CMake configure and build commands are platform agnostic and should work equally + # # well on Windows or Mac. You can convert this to a matrix build if you need + # # cross-platform coverage. + # # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + # runs-on: ubuntu-20.04 + + # steps: + # - uses: actions/checkout@v2 + + # - name: Install catch2 + # run: | + # curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz + # tar xvf catch2.tar.gz + # cd Catch2-2.13.4 + # cmake -Bbuild -H. -DBUILD_TESTING=OFF + # sudo cmake --build build/ --target install + + # - name: Fetch external libs + # run: | + # # Download + # curl http://www.un4seen.com/files/bass24-linux.zip -o bass_linux.zip + # curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus_linux.zip + # curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc_linux.zip + # # Extract + # unzip bass_linux.zip + # unzip bassopus_linux.zip + # unzip discord_rpc_linux.zip + # # Copy + # cp x64/libbass.so lib + # cp x64/libbassopus.so lib + # cp discord-rpc/linux-dynamic/lib/libdiscord-rpc.so lib + + # - name: Install Qt5 + # run: sudo apt update -y && sudo apt install -y qt5-default + + # - name: Install QtApng + # run: | + # git clone https://github.com/Skycoder42/QtApng + # cd QtApng + # qmake + # make + # sudo make install + + # - name: Create Build Environment + # # Some projects don't allow in-source building, so create a separate build directory + # # We'll use this as our working directory for all subsequent commands + # run: cmake -E make_directory ${{github.workspace}}/build + + # - name: Configure CMake + # # Use a bash shell so we can use the same syntax for environment variable + # # access regardless of the host operating system + # shell: bash + # env: + # CC: gcc-10 + # CXX: g++-10 + # working-directory: ${{github.workspace}}/build + # # Note the current convention is to use the -S and -B options here to specify source + # # and build directories, but this is only available with CMake 3.13 and higher. + # # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + # - name: Build + # working-directory: ${{github.workspace}}/build + # shell: bash + # # Execute the build. You can specify a specific target with "--target " + # run: cmake --build . --config $BUILD_TYPE --target Attorney_Online + + # - name: Strip + # working-directory: ${{github.workspace}}/build + # shell: bash + # run: strip -s Attorney_Online + + # - name: Compress + # working-directory: ${{github.workspace}}/build + # shell: bash + # run: tar czvf Attorney_Online-linux-x86_64.tgz Attorney_Online + + # - name: Upload Artifact + # uses: actions/upload-artifact@v2 + # with: + # name: Attorney_Online + # path: ${{github.workspace}}/build/Attorney_Online-linux-x86_64.tgz -- cgit From aef425c112b74be135b7fbe41f13c52117963772 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 19:28:04 -0600 Subject: Downgrade qt version --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aea8c3ec..6dec9938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,15 +20,15 @@ jobs: uses: actions/cache@v1 id: cache with: - path: qt/5.15.2/msvc2019_64 - key: qt-5.15.2-msvc2019_64 + path: qt/5.15.0/msvc2019_64 + key: qt-5.15.0-msvc2019_64 - uses: Skycoder42/action-setup-qt@master id: qt with: - version: 5.15.2 + version: 5.15.0 platform: msvc2019_64 - cachedir: qt/5.15.2/msvc2019_64 + cachedir: qt/5.15.0/msvc2019_64 - name: qmake run: | @@ -41,7 +41,6 @@ jobs: name: Attorney_Online path: ${{github.workspace}}/bin/Attorney_Online - # linux: # # The CMake configure and build commands are platform agnostic and should work equally # # well on Windows or Mac. You can convert this to a matrix build if you need -- cgit From a63f8e0a5f715cef92749b24d94b8385a703403b Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 19:33:33 -0600 Subject: Remove manual cache because it defaults --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dec9938..ab823f0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,20 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: actions/cache qt - uses: actions/cache@v1 - id: cache - with: - path: qt/5.15.0/msvc2019_64 - key: qt-5.15.0-msvc2019_64 - uses: Skycoder42/action-setup-qt@master id: qt with: version: 5.15.0 platform: msvc2019_64 - cachedir: qt/5.15.0/msvc2019_64 - name: qmake run: | -- cgit From d4f24b3109e6f583227c46f08f6a15ad94383f56 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 19:42:21 -0600 Subject: Setup python --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab823f0d..98c49ecf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v2 + + - uses: actions/setup-python@v1 - uses: Skycoder42/action-setup-qt@master id: qt -- cgit From 672b315272668d6491a7581422192955c692ef50 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:04:31 -0600 Subject: Attempt to use different qt installer --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98c49ecf..d4653cd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,18 +16,37 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - - - uses: Skycoder42/action-setup-qt@master - id: qt + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 with: - version: 5.15.0 - platform: msvc2019_64 + path: ${{ github.workspace }}/qt5 + key: ${{ runner.os }}-qt5 + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.15.2' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2019_64' + dir: '${{ github.workspace }}/qt5/' + install-deps: 'true' + modules: '' + cached: ${{ steps.cache-qt.outputs.cache-hit }} + setup-python: 'true' + tools: '' + set-env: 'false' + tools-only: 'false' + aqtversion: '==0.11.1' + py7zrversion: '==0.11.3' + extra: '--external 7z' - name: qmake run: | - qmake CONFIG+=install_ok QT_PLATFORM=msvc2019_64 - ${{steps.qt.outputs.make}} qmake_all + Invoke-BatchFile "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + qmake + nmake - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From 51b77403eb5f3b6e883b96d498521607eedc8c17 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:09:16 -0600 Subject: Try to invoke the bat file better --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4653cd3..3d6bc889 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: host: 'windows' target: 'desktop' arch: 'win64_msvc2019_64' - dir: '${{ github.workspace }}/qt5/' + dir: '${{ github.workspace }}/qt5' install-deps: 'true' modules: '' cached: ${{ steps.cache-qt.outputs.cache-hit }} @@ -44,7 +44,7 @@ jobs: - name: qmake run: | - Invoke-BatchFile "%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" qmake nmake -- cgit From 0cd3351013c294090759a05856df2901d85aa280 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:12:57 -0600 Subject: Change the windows again --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d6bc889..bc4e82a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,9 +43,12 @@ jobs: extra: '--external 7z' - name: qmake + shell: cmd run: | call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + qmake -v qmake + set CL=/MP nmake - name: Upload Artifact -- cgit From 4429d5e630ff73f8b89555b12035c27d2c859718 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:17:17 -0600 Subject: Add new step for compiler --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc4e82a4..d4e6c9c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,13 +42,12 @@ jobs: py7zrversion: '==0.11.3' extra: '--external 7z' + - name: Install compiler + uses: ilammy/msvc-dev-cmd@v1 + - name: qmake - shell: cmd run: | - call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - qmake -v qmake - set CL=/MP nmake - name: Upload Artifact -- cgit From 6ae4e617b0cbb05921f86282b8e74a184cbaa84a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:20:55 -0600 Subject: Attempt to do things again --- .github/workflows/build.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4e6c9c0..dd675d95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,27 +20,15 @@ jobs: id: cache-qt uses: actions/cache@v1 with: - path: ${{ github.workspace }}/qt5 + path: ../Qt key: ${{ runner.os }}-qt5 - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' - host: 'windows' - target: 'desktop' - arch: 'win64_msvc2019_64' - dir: '${{ github.workspace }}/qt5' - install-deps: 'true' - modules: '' - cached: ${{ steps.cache-qt.outputs.cache-hit }} - setup-python: 'true' - tools: '' - set-env: 'false' - tools-only: 'false' - aqtversion: '==0.11.1' - py7zrversion: '==0.11.3' - extra: '--external 7z' + arch: win64_msvc2019_64 + cached: ${{steps.cache-qt.outputs.cache-hit}} - name: Install compiler uses: ilammy/msvc-dev-cmd@v1 -- cgit From afb534bf673332f4e4e16d46ea0971c509dcc8cb Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:29:57 -0600 Subject: Grab bass dependency --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd675d95..79006b5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,17 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Grab bass + run: | + mkdir bass + cd bass + curl http://www.un4seen.com/files/bass24.zip -o bass.zip + unzip bass.zip + cp bass.dll ../lib + curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip + unzip bassopus.zip + cp bassopus.dll ../lib + - name: Cache Qt id: cache-qt uses: actions/cache@v1 -- cgit From 9b36fb8bdaf95baaa3dc2d5b799852384bdb53ad Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:44:25 -0600 Subject: Maybe using cmake will work --- .github/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79006b5d..4c2f0d90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Grab bass + - name: Download BASS run: | mkdir bass cd bass @@ -44,16 +44,17 @@ jobs: - name: Install compiler uses: ilammy/msvc-dev-cmd@v1 - - name: qmake + - name: cmake run: | - qmake - nmake + mkdir build && cd build + cmake .. + make - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: Attorney_Online - path: ${{github.workspace}}/bin/Attorney_Online + path: ${{github.workspace}}/build/Attorney_Online # linux: # # The CMake configure and build commands are platform agnostic and should work equally -- cgit From 2e66e802a17741aa701b067a5210b46bf65f40ba Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:48:43 -0600 Subject: Try using proper cmake steps --- .github/workflows/build.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c2f0d90..9522024f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,14 +41,21 @@ jobs: arch: win64_msvc2019_64 cached: ${{steps.cache-qt.outputs.cache-hit}} - - name: Install compiler - uses: ilammy/msvc-dev-cmd@v1 - - - name: cmake - run: | - mkdir build && cd build - cmake .. - make + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + shell: bash + env: + CC: gcc-10 + CXX: g++-10 + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From 0a1dc4a234600e71dec963b6a2f040867c693735 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:57:12 -0600 Subject: Install Catch2 --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9522024f..b86b6c21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,15 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install catch2 + shell: bash + run: | + curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz + tar xvf catch2.tar.gz + cd Catch2-2.13.4 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + - name: Download BASS run: | mkdir bass -- cgit From f9700bf6eba4681ff447cf3c2182bc21534cbb9d Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:58:59 -0600 Subject: Remove sudo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b86b6c21..f7080e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: tar xvf catch2.tar.gz cd Catch2-2.13.4 cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install + cmake --build build/ --target install - name: Download BASS run: | -- cgit From 6a2e7e16d0615e195d7db3ae93be04eafc628bc8 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Tue, 26 Jan 2021 21:38:52 -0600 Subject: Remove unneeded option --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7080e81..1a44a7a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,6 @@ jobs: uses: jurplel/install-qt-action@v2 with: version: '5.15.2' - arch: win64_msvc2019_64 cached: ${{steps.cache-qt.outputs.cache-hit}} - name: Create Build Environment -- cgit From 214e94146426b29c7db5257c55897369f0c2bc32 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 01:57:41 -0600 Subject: Make this just install qt for cache --- .github/workflows/build.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a44a7a0..60da628f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,27 +49,27 @@ jobs: version: '5.15.2' cached: ${{steps.cache-qt.outputs.cache-hit}} - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - shell: bash - env: - CC: gcc-10 - CXX: g++-10 - working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: Attorney_Online - path: ${{github.workspace}}/build/Attorney_Online + # - name: Create Build Environment + # run: cmake -E make_directory ${{github.workspace}}/build + + # - name: Configure CMake + # shell: bash + # env: + # CC: gcc-10 + # CXX: g++-10 + # working-directory: ${{github.workspace}}/build + # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + # - name: Build + # working-directory: ${{github.workspace}}/build + # shell: bash + # run: cmake --build . --config $BUILD_TYPE --target Attorney_Online + + # - name: Upload Artifact + # uses: actions/upload-artifact@v2 + # with: + # name: Attorney_Online + # path: ${{github.workspace}}/build/Attorney_Online # linux: # # The CMake configure and build commands are platform agnostic and should work equally -- cgit From bb63cfd1781783b26f3083a16c3c7d0ec6b45b2a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:04:37 -0600 Subject: Renable build and copy more bass --- .github/workflows/build.yml | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60da628f..b301e35f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,10 +31,10 @@ jobs: cd bass curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp bass.dll ../lib + cp bass.dll c/bass.lib ../lib curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp bassopus.dll ../lib + cp bassopus.dll c/bassopus.lib ../lib - name: Cache Qt id: cache-qt @@ -49,27 +49,27 @@ jobs: version: '5.15.2' cached: ${{steps.cache-qt.outputs.cache-hit}} - # - name: Create Build Environment - # run: cmake -E make_directory ${{github.workspace}}/build - - # - name: Configure CMake - # shell: bash - # env: - # CC: gcc-10 - # CXX: g++-10 - # working-directory: ${{github.workspace}}/build - # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - # - name: Build - # working-directory: ${{github.workspace}}/build - # shell: bash - # run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: Attorney_Online - # path: ${{github.workspace}}/build/Attorney_Online + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + shell: bash + env: + CC: gcc-10 + CXX: g++-10 + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target Attorney_Online + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: Attorney_Online + path: ${{github.workspace}}/build/Attorney_Online # linux: # # The CMake configure and build commands are platform agnostic and should work equally -- cgit From 23b1cf470388e66e914af03c7091fde92b351f0a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:07:55 -0600 Subject: Change the copy --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b301e35f..9b122d09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,10 +31,12 @@ jobs: cd bass curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp bass.dll c/bass.lib ../lib + cp bass.dll ../lib + cp ./c/bass.lib ../lib curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp bassopus.dll c/bassopus.lib ../lib + cp bassopus.dll ../lib + cp ./c/bassopus.lib ../lib - name: Cache Qt id: cache-qt -- cgit From 7a9cb6a00cafa9ca5f12d2f962fde6bb53ab9f5d Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:18:56 -0600 Subject: Grab discord-rpc too --- .github/workflows/build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b122d09..60c90234 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,17 +25,23 @@ jobs: cmake -Bbuild -H. -DBUILD_TESTING=OFF cmake --build build/ --target install - - name: Download BASS + - name: Fetch external libs run: | + # discord-rpc + curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip + unzip discord_rpc_linux.zip + cp discord-rpc/win64-static/lib/discord-rpc.lib ../lib + + # BASS mkdir bass cd bass curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp bass.dll ../lib cp ./c/bass.lib ../lib + + # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp bassopus.dll ../lib cp ./c/bassopus.lib ../lib - name: Cache Qt -- cgit From ecf472d4a20f634aa0738fbc9800eda0a5ab842b Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:21:11 -0600 Subject: Fix typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60c90234..326a69b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: run: | # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip - unzip discord_rpc_linux.zip + unzip discord_rpc_win.zip cp discord-rpc/win64-static/lib/discord-rpc.lib ../lib # BASS -- cgit From 0074bd0e708931f52bcaef2fe40583ffbc3f6e8f Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:25:57 -0600 Subject: Copy the dynamic lib --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 326a69b0..f85746ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install catch2 + - name: Install Catch2 shell: bash run: | curl -L https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz -o catch2.tar.gz @@ -30,7 +30,7 @@ jobs: # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip unzip discord_rpc_win.zip - cp discord-rpc/win64-static/lib/discord-rpc.lib ../lib + cp discord-rpc/win64-dynamic/lib/discord-rpc.lib ../lib # BASS mkdir bass -- cgit From 46d6b6719b7e2fc30fd49a892ae4f7cec2256fc7 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:34:43 -0600 Subject: Try using win32 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f85746ec..234d1568 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip unzip discord_rpc_win.zip - cp discord-rpc/win64-dynamic/lib/discord-rpc.lib ../lib + cp discord-rpc/win32-static/lib/discord-rpc.lib ../lib # BASS mkdir bass -- cgit From ea9284d18dcac42ba2e6600ce742370d7ebf0940 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:41:12 -0600 Subject: Fix paths and remove env --- .github/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 234d1568..6ce3a470 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,19 +30,17 @@ jobs: # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip unzip discord_rpc_win.zip - cp discord-rpc/win32-static/lib/discord-rpc.lib ../lib + cp ./discord-rpc/win64-static/lib/discord-rpc.lib ./lib # BASS - mkdir bass - cd bass curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp ./c/bass.lib ../lib + cp ./c/bass.lib ./lib # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp ./c/bassopus.lib ../lib + cp ./c/bassopus.lib ./lib - name: Cache Qt id: cache-qt @@ -62,9 +60,6 @@ jobs: - name: Configure CMake shell: bash - env: - CC: gcc-10 - CXX: g++-10 working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -- cgit From 8d7d04e2841efc5f06d9f552d9981e9005bd2194 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:45:29 -0600 Subject: Copy the dynamic dll over as well --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce3a470..e11e7415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,11 +35,13 @@ jobs: # BASS curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip + cp bass.dll ./lib cp ./c/bass.lib ./lib # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip + cp bassopus.dll ./lib cp ./c/bassopus.lib ./lib - name: Cache Qt -- cgit From e9a53b1f88411c75fa29f599d7d5551fe8b1ee8a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:47:44 -0600 Subject: Copy the bass x64 dll --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e11e7415..7aed82b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,14 +35,12 @@ jobs: # BASS curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp bass.dll ./lib - cp ./c/bass.lib ./lib + cp ./x64/bass.dll ./lib # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp bassopus.dll ./lib - cp ./c/bassopus.lib ./lib + cp ./x64/bassopus.dll ./lib - name: Cache Qt id: cache-qt -- cgit From 3bd57190f05ad15b646a924124520ad0d9ed76d3 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:52:59 -0600 Subject: Add lib as well --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7aed82b3..af894494 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,11 +35,13 @@ jobs: # BASS curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip + cp ./c/bass.lib ./lib cp ./x64/bass.dll ./lib # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip + cp ./c/bassopus.lib ./lib cp ./x64/bassopus.dll ./lib - name: Cache Qt -- cgit From 712a48cbacbc6fab22cba6db79432b9080ab61cc Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:58:43 -0600 Subject: Use the x64 bass lib --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af894494..bfcb995d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,14 +35,12 @@ jobs: # BASS curl http://www.un4seen.com/files/bass24.zip -o bass.zip unzip bass.zip - cp ./c/bass.lib ./lib - cp ./x64/bass.dll ./lib + cp ./c/x64/bass.lib ./lib # BASS Opus curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip unzip bassopus.zip - cp ./c/bassopus.lib ./lib - cp ./x64/bassopus.dll ./lib + cp ./c/x64/bassopus.lib ./lib - name: Cache Qt id: cache-qt -- cgit From af6cacf9d0f49579a9d2311db0cf9a2a302f5c62 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 03:02:30 -0600 Subject: Upload the right artifact --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfcb995d..61e6e14a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,7 +72,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: Attorney_Online - path: ${{github.workspace}}/build/Attorney_Online + path: ${{github.workspace}}/build/Release/Attorney_Online.exe # linux: # # The CMake configure and build commands are platform agnostic and should work equally -- cgit From 353ed0746444f0b2bfb1f9d853ca479778c37072 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 03:07:16 -0600 Subject: Rename to zip since artifact is a zip --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61e6e14a..45b020a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: Attorney_Online + name: Attorney_Online.zip path: ${{github.workspace}}/build/Release/Attorney_Online.exe # linux: -- cgit From 4e188747621db75a5cbcbfe9f8187b0dc4a2c74c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 16:56:09 -0600 Subject: Attempt to deploy --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45b020a9..b9ad3474 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,11 @@ jobs: shell: bash run: cmake --build . --config $BUILD_TYPE --target Attorney_Online + - name: Deploy + working-directory: ${{github.workspace}}/build + shell: bash + run: windeployqt Attorney_Online && ls build + - name: Upload Artifact uses: actions/upload-artifact@v2 with: -- cgit From 196982ffe5d26688c3f49ff4deca5e1dcbcb1f2a Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:00:09 -0600 Subject: Add in extension --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9ad3474..61091c78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: - name: Deploy working-directory: ${{github.workspace}}/build shell: bash - run: windeployqt Attorney_Online && ls build + run: windeployqt Attorney_Online.exe && ls build - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From e4152f577b784eea30f76d20979279ae62476806 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:04:34 -0600 Subject: Fix path --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61091c78..94993bd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,9 +69,9 @@ jobs: run: cmake --build . --config $BUILD_TYPE --target Attorney_Online - name: Deploy - working-directory: ${{github.workspace}}/build + working-directory: ${{github.workspace}}/build/Release shell: bash - run: windeployqt Attorney_Online.exe && ls build + run: windeployqt . && ls build - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From 232a299612856764df9065a857758e95641def8e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:15:46 -0600 Subject: Remove listing directory --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94993bd4..67976013 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: - name: Deploy working-directory: ${{github.workspace}}/build/Release shell: bash - run: windeployqt . && ls build + run: windeployqt . - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From 1871a43dc83e6fff4b1a7f2d8b2ffc2aeaca3b3e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:25:29 -0600 Subject: Upload the release folder --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67976013..6d3d1e1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,8 +76,8 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: Attorney_Online.zip - path: ${{github.workspace}}/build/Release/Attorney_Online.exe + name: Attorney_Online-x64.zip + path: ${{github.workspace}}/build/Release/ # linux: # # The CMake configure and build commands are platform agnostic and should work equally -- cgit From 56f8d1505cc0db3179640321aaf77b9fc715e10e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:30:48 -0600 Subject: Remove unnecessary .zip extension to the name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d3d1e1a..1ed769e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,7 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: Attorney_Online-x64.zip + name: Attorney_Online-x64 path: ${{github.workspace}}/build/Release/ # linux: -- cgit From ed91d60332e2809f580771afdefd80eecb6dbf85 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:52:36 -0600 Subject: Use dynamic discord-rpc and copy libs to release folder --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ed769e6..b07b9cc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip unzip discord_rpc_win.zip - cp ./discord-rpc/win64-static/lib/discord-rpc.lib ./lib + cp ./discord-rpc/win64-dynamic/lib/discord-rpc.lib ./lib # BASS curl http://www.un4seen.com/files/bass24.zip -o bass.zip @@ -71,7 +71,11 @@ jobs: - name: Deploy working-directory: ${{github.workspace}}/build/Release shell: bash - run: windeployqt . + run: | + windeployqt . + cp ${{github.workspace}}/discord-rpc/win64-dynamic/bin/discord-rpc.dll . + cp ${{github.workspace}}/x64/bass.dll . + cp ${{github.workspace}}/x64/bassopus.dll . - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From b55082a676fc141c64c18914b7e236a067c3087f Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:59:25 -0600 Subject: Use the relative paths to be compatible with the bash shell --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b07b9cc5..a22f5959 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,9 +73,9 @@ jobs: shell: bash run: | windeployqt . - cp ${{github.workspace}}/discord-rpc/win64-dynamic/bin/discord-rpc.dll . - cp ${{github.workspace}}/x64/bass.dll . - cp ${{github.workspace}}/x64/bassopus.dll . + cp ../../discord-rpc/win64-dynamic/bin/discord-rpc.dll . + cp ../../x64/bass.dll . + cp ../../x64/bassopus.dll . - name: Upload Artifact uses: actions/upload-artifact@v2 -- cgit From d4a2282a3e468b22a36b59d6ed16ec1cdddad833 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 18:18:44 -0600 Subject: Get QtApng --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a22f5959..69b12842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,10 @@ jobs: - name: Fetch external libs run: | + # QtApng + curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.4/qtapng-msvc2017_64-5.14.1.zip -o apng.zip + unzip apng.zip + # discord-rpc curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc_win.zip unzip discord_rpc_win.zip @@ -73,6 +77,7 @@ jobs: shell: bash run: | windeployqt . + cp ../../msvc2017_64/plugins/imageformats/qapng.dll ./imageformats/ cp ../../discord-rpc/win64-dynamic/bin/discord-rpc.dll . cp ../../x64/bass.dll . cp ../../x64/bassopus.dll . -- cgit From 5ac4a9ed979755c6dc20e818650d3fbf0667bc10 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 23:40:57 -0600 Subject: Set property for win32 exectuable to true --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 495f9731..80412549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,13 @@ endif() # AO add_executable(Attorney_Online resources.qrc) +# WIN32 +if(WIN32) + if(CMAKE_BUILD_TYPE STREQUAL "Release") + set_property(TARGET Attorney_Online PROPERTY WIN32_EXECUTABLE true) + endif() +endif() + # Target Include target_include_directories(Attorney_Online PRIVATE include) -- cgit From c7c5f5bf2dd402b28de125f84159eeb0e0961175 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 27 Jan 2021 23:56:42 -0600 Subject: Add icon to windows executable --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80412549..b6b02106 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,8 @@ add_executable(Attorney_Online resources.qrc) if(WIN32) if(CMAKE_BUILD_TYPE STREQUAL "Release") set_property(TARGET Attorney_Online PROPERTY WIN32_EXECUTABLE true) + set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/resource/logo_ao2.rc") + target_sources(Attorney_Online PRIVATE ${APP_ICON_RESOURCE_WINDOWS}) endif() endif() -- cgit From 33ba7a3ea0c28e53286ba4fe37c8abf30483ce1c Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 28 Jan 2021 10:10:40 -0600 Subject: Disable workflow trigger to make hopefully make it work --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69b12842..4a03840f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: build -on: - push: - branches: - - add-tests +# on: +# push: +# branches: +# - add-tests env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -- cgit From 29370b49cb3c9224adf2beb3b5d6197ca33aa365 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 28 Jan 2021 10:11:14 -0600 Subject: Rename push workflow --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a03840f..69b12842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: build -# on: -# push: -# branches: -# - add-tests +on: + push: + branches: + - add-tests env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -- cgit From 9242c3dd0d6429ae79679c1f7a2846c228f6d3e8 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Thu, 28 Jan 2021 10:15:33 -0600 Subject: Add the rc file --- resource/logo_ao2.rc | 1 + 1 file changed, 1 insertion(+) create mode 100644 resource/logo_ao2.rc diff --git a/resource/logo_ao2.rc b/resource/logo_ao2.rc new file mode 100644 index 00000000..ed785de8 --- /dev/null +++ b/resource/logo_ao2.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON "logo_ao2.ico" -- cgit