From 639441dc417e094f496677890431ff5134ecc1ef Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 19:58:51 +0100 Subject: [PATCH 01/13] Create meson.yml --- .github/workflows/meson.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/meson.yml diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml new file mode 100644 index 0000000..5ec559c --- /dev/null +++ b/.github/workflows/meson.yml @@ -0,0 +1,50 @@ +name: Build with Meson + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build and Test on ${{ matrix.os }} with Meson v1.7.0 + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + include: + - os: windows-latest + cpp_compiler: cl + - os: ubuntu-latest + cpp_compiler: g++ + - os: ubuntu-latest + cpp_compiler: clang++ + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: python -m pip install meson==1.7.0 ninja + - name: Configure Project + run: meson setup build + env: + CC: ${{ matrix.cpp_compiler }} + - name: Build Project + run: ninja -C build + env: + CC: ${{ matrix.cpp_compiler }} From f12fa23c43356de3ab48ea46972319ee61b3ef19 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:07:55 +0100 Subject: [PATCH 02/13] Update meson.yml Added dependencies, removed windows for now --- .github/workflows/meson.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 5ec559c..5012c33 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -21,11 +21,9 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] build_type: [Release] include: - - os: windows-latest - cpp_compiler: cl - os: ubuntu-latest cpp_compiler: g++ - os: ubuntu-latest @@ -34,12 +32,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: python -m pip install meson==1.7.0 ninja + - name: Install meson and ninja + run: apt install meson ninja-build + - name: Get dependencies + run: apt install libopencv-dev qt6-base && meson wrap install nlohmann_json - name: Configure Project run: meson setup build env: From b4177dc9ed993d26896fe6034d8e0adff26172d0 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:11:35 +0100 Subject: [PATCH 03/13] Elevating privileges --- .github/workflows/meson.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 5012c33..ecc84ec 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -33,9 +33,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Install meson and ninja - run: apt install meson ninja-build + run: sudo apt install -y meson ninja-build - name: Get dependencies - run: apt install libopencv-dev qt6-base && meson wrap install nlohmann_json + run: sudo apt install -y libopencv-dev qt6-base && meson wrap install nlohmann_json - name: Configure Project run: meson setup build env: From 6619630fa45c3f1abf4d2ffbc8766052431aa1f1 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:23:59 +0100 Subject: [PATCH 04/13] Added workflow branch --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index ecc84ec..648b9ea 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -2,7 +2,7 @@ name: Build with Meson on: push: - branches: [ "main" ] + branches: [ "main", "workflow" ] pull_request: branches: [ "main" ] From 052a7bd80a6bf9fa153ea4a7305d0d9aed147803 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:26:43 +0100 Subject: [PATCH 05/13] Update qt6 package name --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 648b9ea..beb367d 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -35,7 +35,7 @@ jobs: - name: Install meson and ninja run: sudo apt install -y meson ninja-build - name: Get dependencies - run: sudo apt install -y libopencv-dev qt6-base && meson wrap install nlohmann_json + run: sudo apt install -y libopencv-dev qt6-base-dev && meson wrap install nlohmann_json - name: Configure Project run: meson setup build env: From 1eba50bc04bd06eda23cbac1abe79faa8dd9b6b2 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:35:26 +0100 Subject: [PATCH 06/13] Seperate deps to see what causes error --- .github/workflows/meson.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index beb367d..1f8c5cc 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -34,8 +34,12 @@ jobs: uses: actions/checkout@v4 - name: Install meson and ninja run: sudo apt install -y meson ninja-build - - name: Get dependencies - run: sudo apt install -y libopencv-dev qt6-base-dev && meson wrap install nlohmann_json + - name: Get opencv + run: sudo apt install -y libopencv-dev + - name: Get QT6 + run: sudo apt install -y qt6-base-dev + - name: Get nlohman_json + run: meson wrap install nlohmann_json - name: Configure Project run: meson setup build env: From d496b3389d85535811a52bbfed103480d30bd013 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:42:00 +0100 Subject: [PATCH 07/13] Unify dependencies --- .github/workflows/meson.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 1f8c5cc..f675434 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -34,12 +34,8 @@ jobs: uses: actions/checkout@v4 - name: Install meson and ninja run: sudo apt install -y meson ninja-build - - name: Get opencv - run: sudo apt install -y libopencv-dev - - name: Get QT6 - run: sudo apt install -y qt6-base-dev - - name: Get nlohman_json - run: meson wrap install nlohmann_json + - name: Get dependencies + run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann_json3 - name: Configure Project run: meson setup build env: From ad96ad19a0d3655a00c8086dfdd52a832784266c Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:43:14 +0100 Subject: [PATCH 08/13] Update nlohman package name --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index f675434..22b71e3 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -35,7 +35,7 @@ jobs: - name: Install meson and ninja run: sudo apt install -y meson ninja-build - name: Get dependencies - run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann_json3 + run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann-json3-dev - name: Configure Project run: meson setup build env: From eec3f3c5d8d0568bce00ca9f434dafbca9c57322 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:45:15 +0100 Subject: [PATCH 09/13] Add cups dependency --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 22b71e3..da8cb7d 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -35,7 +35,7 @@ jobs: - name: Install meson and ninja run: sudo apt install -y meson ninja-build - name: Get dependencies - run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann-json3-dev + run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann-json3-dev cups - name: Configure Project run: meson setup build env: From e425c0b0c5d694d31f73e38c460355f466318672 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:49:22 +0100 Subject: [PATCH 10/13] Replace cups with actual package --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index da8cb7d..b108819 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -35,7 +35,7 @@ jobs: - name: Install meson and ninja run: sudo apt install -y meson ninja-build - name: Get dependencies - run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann-json3-dev cups + run: sudo apt install -y libopencv-dev qt6-base-dev nlohmann-json3-dev libcups2-dev - name: Configure Project run: meson setup build env: From b61d0c1a1941e9a780f1cf8fdcd4181eb08db73f Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:56:59 +0100 Subject: [PATCH 11/13] Trying to get it to work with both g++ and clang++ --- .github/workflows/meson.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index b108819..4c72cb5 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -8,7 +8,7 @@ on: jobs: build: - name: Build and Test on ${{ matrix.os }} with Meson v1.7.0 + name: Build on ${{ matrix.os }} with Meson v1.7.0 runs-on: ${{ matrix.os }} strategy: @@ -22,13 +22,9 @@ jobs: # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: os: [ubuntu-latest] + cpp_compiler: [g++, clang++] build_type: [Release] - include: - - os: ubuntu-latest - cpp_compiler: g++ - - os: ubuntu-latest - cpp_compiler: clang++ - + steps: - name: Checkout code uses: actions/checkout@v4 From 4eb79677dac49f304130e3d7a2e44e44323b656f Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 20:58:51 +0100 Subject: [PATCH 12/13] Rename job to include compiler --- .github/workflows/meson.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 4c72cb5..1e8ce7b 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -8,7 +8,7 @@ on: jobs: build: - name: Build on ${{ matrix.os }} with Meson v1.7.0 + name: Build on ${{ matrix.os }} with ${{ matrix.cpp_compiler }} runs-on: ${{ matrix.os }} strategy: From 68e3c67c745aa3842bd32941fa4b4f0e64ac8125 Mon Sep 17 00:00:00 2001 From: levy <84914593+levy04@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:01:29 +0100 Subject: [PATCH 13/13] Delete old workflow --- .github/workflows/cmake-multi-platform.yml | 93 ---------------------- 1 file changed, 93 deletions(-) delete mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml deleted file mode 100644 index cd53469..0000000 --- a/.github/workflows/cmake-multi-platform.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: CMake on multiple platforms - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. - fail-fast: false - - # Set up a matrix to run the following 3 configurations: - # 1. - # 2. - # 3. - # - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. - matrix: - os: [ubuntu-latest, windows-latest] - build_type: [Release] - c_compiler: [gcc, clang, cl] - include: - - os: windows-latest - c_compiler: cl - cpp_compiler: cl - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - - os: ubuntu-latest - c_compiler: clang - cpp_compiler: clang++ - exclude: - - os: windows-latest - c_compiler: gcc - - os: windows-latest - c_compiler: clang - - os: ubuntu-latest - c_compiler: cl - - steps: - - uses: actions/checkout@v4 - - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: run-vcpkg - # You may pin to the exact commit or the version. - # uses: lukka/run-vcpkg@8a5116de2b552d6fc8894e9774aacaf2e5db4823 - uses: lukka/run-vcpkg@v7.6 - with: - # Indicates whether to only setup vcpkg (i.e. installing it and setting the environment variables VCPKG_ROOT, RUNVCPK_VCPKG_ROOT), without installing any port. - setupOnly: true - # Specify the URL Git repository to download vcpkg from. Defaults to https://github.com/microsoft/vcpkg.git - vcpkgGitURL: https://github.com/microsoft/vcpkg.git - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - 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 }} - -S ${{ github.workspace }} - - - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} -