diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 8444b66..b0e6fcf 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest] build_type: [Release,Debug] c_compiler: [gcc, clang, cl] include: @@ -29,9 +29,6 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - - os: macos-latest - c_compiler: clang - cpp_compiler: clang++ exclude: - os: windows-latest c_compiler: gcc @@ -39,10 +36,6 @@ jobs: c_compiler: clang - os: ubuntu-latest c_compiler: cl - - os: macos-latest - c_compiler: cl - - os: macos-latest - c_compiler: gcc steps: - uses: actions/checkout@v4 @@ -51,20 +44,35 @@ jobs: id: strings shell: bash run: | - echo "test-build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT" + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Configure CMake + - name: Install dependencies (linux) + if: matrix.os == 'ubuntu-latest' run: > - cmake -B ${{ steps.strings.outputs.test-build-output-dir }} + sudo apt install -y libjpeg8-dev libpng-dev libasound2-dev + alsa-utils alsa-oss libx11-dev libxft-dev libxcursor-dev + + - name: Configure CMake (gui) + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -DNSTALL_CLI_ONLY=ON -S ${{ github.workspace }} - - name: Build for tests - run: cmake --build ${{ steps.strings.outputs.test-build-output-dir }} --config ${{ matrix.build_type }} + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - name: Test - working-directory: ${{ steps.strings.outputs.test-build-output-dir }}/tests - run: ctest --build-config ${{ matrix.build_type }} --output-on-failure + uses: coactions/setup-xvfb@v1 + with: + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure + working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests + + - name: Create build artifact + if: ${{ matrix.build_type == 'Release' }} + uses: actions/upload-artifact@v4 + with: + name: build-out-${{ matrix.os }}-${{ matrix.c_compiler }} + path: ${{ steps.strings.outputs.build-output-dir }} + retention-days: 5 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 406f189..f1c7536 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ build *.profraw .cache compile_commands.json +.vs +CMakeSettings.json +out # testing binaries -*_Installer +*_Installer* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 03a1a82..3643a0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,8 @@ if(NOT NSTALL_CLI_ONLY) message(STATUS "Fetching dependency: nana") FetchContent_Declare( nana - GIT_REPOSITORY https://github.com/cnjinhao/nana - GIT_TAG 96d48b8413866028f5d284ee55b763ceab7aeb1f) + GIT_REPOSITORY https://github.com/niten01/nana + GIT_TAG 4bbf352bebbf912983319c3d784a9b38aad828fd) FetchContent_MakeAvailable(nana) set_target_properties(nana PROPERTIES CXX_STANDARD 17) target_link_libraries(${COMMON_TARGET} PUBLIC nana) diff --git a/src/Constructor/ConstructorForm.cpp b/src/Constructor/ConstructorForm.cpp index 592f235..a1fc557 100644 --- a/src/Constructor/ConstructorForm.cpp +++ b/src/Constructor/ConstructorForm.cpp @@ -175,8 +175,8 @@ void ConstructorForm::onMainClick() { fs::path directory{ directoryTextBox_.text() }; nana::filebox fb{ *this, false }; - fb.init_file(fs::current_path() / - (programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION)); + fb.init_file((fs::current_path() / + (programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION)).string()); fb.add_filter("Executable", "*." NSTALL_EXE_EXTENSION); fb.allow_multi_select(false); auto paths{ fb.show() }; diff --git a/src/Constructor/ConstructorMain.cpp b/src/Constructor/ConstructorMain.cpp index 67db828..f0a9efe 100644 --- a/src/Constructor/ConstructorMain.cpp +++ b/src/Constructor/ConstructorMain.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #ifndef NSTALL_CLI_ONLY #include "nstall/Constructor/ConstructorForm.hpp" #define FORCE_CLI false @@ -35,6 +36,7 @@ auto main(int argc, char* argv[]) -> int { nstall::ConstructorForm constructor{ resourcesDir }; constructor.run(); } catch (const nstall::ConstructorFormException& e) { + std::cerr << e.what() << std::endl; nana::msgbox err{ "Error" }; err.icon(nana::msgbox::icon_error); err << e.what(); diff --git a/src/Installer/InstallerForm.cpp b/src/Installer/InstallerForm.cpp index 369fe82..155d2da 100644 --- a/src/Installer/InstallerForm.cpp +++ b/src/Installer/InstallerForm.cpp @@ -68,7 +68,7 @@ void InstallerForm::createForm() { title_.text_align(nana::align::center); title_.typeface(nana::paint::font{ styler.font(), 20, nana::paint::font::font_style{ 500 } }); - title_.caption(metaInfo_->programName()); + title_.caption(metaInfo_->programName() + " Installer"); styler.stylize(title_); mainLayout_["title"] << title_; diff --git a/src/Installer/InstallerMain.cpp b/src/Installer/InstallerMain.cpp index 7def71e..9acaaf1 100644 --- a/src/Installer/InstallerMain.cpp +++ b/src/Installer/InstallerMain.cpp @@ -8,6 +8,7 @@ #include #include #include +#include auto main(int argc, char** argv) -> int { @@ -28,6 +29,7 @@ auto main(int argc, char** argv) -> int { nstall::InstallerForm installer{ argv[0] }; installer.run(); } catch (const nstall::InstallerFormException& e) { + std::cerr << e.what() << std::endl; nana::msgbox err{ "Error" }; err.icon(nana::msgbox::icon_error); err << e.what();