From 9cb8a51715f39c62e48cf01079432f435f3aca43 Mon Sep 17 00:00:00 2001 From: Dalton-V Date: Mon, 17 Aug 2026 16:13:44 -0500 Subject: [PATCH 1/2] Fix PR Triggers --- .github/workflows/cpp-ci-serial-programs-mac-intel.yml | 8 ++++++-- .github/workflows/cpp-ci-serial-programs-mac.yml | 8 ++++++-- .github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml | 8 ++++++-- .../workflows/cpp-ci-serial-programs-ubuntu-default.yml | 8 ++++++-- .../workflows/cpp-ci-serial-programs-windows-clang.yml | 8 ++++++-- .../workflows/cpp-ci-serial-programs-windows-default.yml | 8 ++++++-- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cpp-ci-serial-programs-mac-intel.yml b/.github/workflows/cpp-ci-serial-programs-mac-intel.yml index 44fa3144b9..cdf8dc6dd7 100644 --- a/.github/workflows/cpp-ci-serial-programs-mac-intel.yml +++ b/.github/workflows/cpp-ci-serial-programs-mac-intel.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Mac Intel -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -8,4 +12,4 @@ jobs: with: os: macos-15-intel compiler: default - run-tests: true \ No newline at end of file + run-tests: true diff --git a/.github/workflows/cpp-ci-serial-programs-mac.yml b/.github/workflows/cpp-ci-serial-programs-mac.yml index c4c6fc450c..3a59c7d0ef 100644 --- a/.github/workflows/cpp-ci-serial-programs-mac.yml +++ b/.github/workflows/cpp-ci-serial-programs-mac.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Mac -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -8,4 +12,4 @@ jobs: with: os: macos-15 compiler: default - run-tests: true \ No newline at end of file + run-tests: true diff --git a/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml b/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml index 5615b95442..097ec3c442 100644 --- a/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml +++ b/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Ubuntu clang -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -8,4 +12,4 @@ jobs: with: os: ubuntu-26.04 compiler: clang - run-clang-query: true \ No newline at end of file + run-clang-query: true diff --git a/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml b/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml index 5d88580cec..c3ebd5f69b 100644 --- a/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml +++ b/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Ubuntu Default -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -8,4 +12,4 @@ jobs: with: os: ubuntu-26.04 compiler: default - run-clang-query: true \ No newline at end of file + run-clang-query: true diff --git a/.github/workflows/cpp-ci-serial-programs-windows-clang.yml b/.github/workflows/cpp-ci-serial-programs-windows-clang.yml index 551fbc2a76..b725cc4c98 100644 --- a/.github/workflows/cpp-ci-serial-programs-windows-clang.yml +++ b/.github/workflows/cpp-ci-serial-programs-windows-clang.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Windows Clang -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -9,4 +13,4 @@ jobs: os: windows-2025 compiler: clang upload-build: true - run-tests: true \ No newline at end of file + run-tests: true diff --git a/.github/workflows/cpp-ci-serial-programs-windows-default.yml b/.github/workflows/cpp-ci-serial-programs-windows-default.yml index d987ed610c..35940e1c94 100644 --- a/.github/workflows/cpp-ci-serial-programs-windows-default.yml +++ b/.github/workflows/cpp-ci-serial-programs-windows-default.yml @@ -1,5 +1,9 @@ name: C++ CI Serial Programs Windows Default -on: [push, pull_request, workflow_dispatch] +on: + push: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: build: @@ -9,4 +13,4 @@ jobs: os: windows-2025 compiler: default upload-build: true - run-tests: true \ No newline at end of file + run-tests: true From 935cfec5b2c4e044bd3e4e7d75bef29feeb3448c Mon Sep 17 00:00:00 2001 From: Dalton-V Date: Mon, 17 Aug 2026 16:19:36 -0500 Subject: [PATCH 2/2] Enable Ubuntu Tests --- .../workflows/cpp-ci-serial-programs-base.yml | 271 +++++++++--------- .../cpp-ci-serial-programs-ubuntu-clang.yml | 1 + .../cpp-ci-serial-programs-ubuntu-default.yml | 1 + 3 files changed, 142 insertions(+), 131 deletions(-) diff --git a/.github/workflows/cpp-ci-serial-programs-base.yml b/.github/workflows/cpp-ci-serial-programs-base.yml index 6a4a6d6ea9..944f4d39d5 100644 --- a/.github/workflows/cpp-ci-serial-programs-base.yml +++ b/.github/workflows/cpp-ci-serial-programs-base.yml @@ -2,7 +2,7 @@ name: C++ CI Serial Programs base on: workflow_call: inputs: - os: + os: required: true type: string @@ -27,136 +27,145 @@ jobs: runs-on: ${{inputs.os}} steps: - - name: Set variables - shell: bash - run: | - if [[ "${{inputs.compiler}}" == "clang" ]]; then + - name: Set variables + shell: bash + run: | + if [[ "${{inputs.compiler}}" == "clang" ]]; then + if [[ "${{inputs.os}}" == windows* ]]; then + CMAKE_ADDITIONAL_FLAGS="-T ClangCL" + elif [[ "${{inputs.os}}" == ubuntu* ]]; then + CMAKE_ADDITIONAL_FLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo" + fi + fi + echo "CMAKE_ADDITIONAL_FLAGS=$CMAKE_ADDITIONAL_FLAGS" >> $GITHUB_ENV + if [[ "${{inputs.os}}" == windows* ]]; then - CMAKE_ADDITIONAL_FLAGS="-T ClangCL" - elif [[ "${{inputs.os}}" == ubuntu* ]]; then - CMAKE_ADDITIONAL_FLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" + UPLOAD_FOLDER="Arduino-Source/SerialPrograms/bin/RelWithDebInfo" + else + UPLOAD_FOLDER="Arduino-Source/SerialPrograms/bin" fi - fi - echo "CMAKE_ADDITIONAL_FLAGS=$CMAKE_ADDITIONAL_FLAGS" >> $GITHUB_ENV - - if [[ "${{inputs.os}}" == windows* ]]; then - UPLOAD_FOLDER="Arduino-Source/SerialPrograms/bin/RelWithDebInfo" - else - UPLOAD_FOLDER="Arduino-Source/SerialPrograms/bin" - fi - echo "UPLOAD_FOLDER=$UPLOAD_FOLDER" >> $GITHUB_ENV - - - name: Checkout Arduino-Source - uses: actions/checkout@v7 - with: - path: 'Arduino-Source' - submodules: 'recursive' - - - name: Install Qt - uses: jurplel/install-qt-action@v4 - with: - # Delete aqtsource once https://github.com/miurahr/aqtinstall/issues/1007 is fixed and released - aqtsource: 'git+https://github.com/miurahr/aqtinstall' - version: '6.10.2' - modules: 'qtmultimedia qtserialport' - - - name: Install dependencies (Ubuntu) - if: startsWith(inputs.os, 'ubuntu') - run: | - cd Arduino-Source - sudo apt update - sudo apt upgrade - sudo apt install clang-tools libopencv-dev libsystemd-dev - - sudo apt install ./3rdPartyBinaries/libdpp-10.1.5-linux-x64.deb - - - name: Install dependencies (Mac) - if: startsWith(inputs.os, 'mac') - run: | - cd Arduino-Source - brew install opencv@4 onnxruntime - - brew tap-new --no-git PA/libdpp - brew trust PA/libdpp - FORMULA_DIR="$(brew --repo PA/libdpp)/Formula" - mkdir -p "$FORMULA_DIR" - cp 3rdPartyBinaries/libdpp@10.1.5.rb "$FORMULA_DIR/" - brew install libdpp@10.1.5 - - - name: Generate binaries - run: | - cd Arduino-Source/SerialPrograms - mkdir bin - cd bin - cmake .. -DQT_MAJOR:STRING=6 ${{env.CMAKE_ADDITIONAL_FLAGS}} - cmake --build . --config RelWithDebInfo --parallel 10 - - - name: Prepare upload build - if: inputs.upload-build - shell: bash - run: | - { - echo "https://github.com/${{github.repository_owner}}/Arduino-Source/commit/$(git -C Arduino-Source rev-parse HEAD)" - echo "https://github.com/${{github.repository_owner}}/Packages/commit/$(git -C Arduino-Source/Packages rev-parse HEAD)" - } > ${{env.UPLOAD_FOLDER}}/version.txt - - - name: Upload Build - uses: actions/upload-artifact@v7 - if: inputs.upload-build - with: - name: Serial Programs (os=${{inputs.os}} - compiler=${{inputs.compiler}}) - path: ${{env.UPLOAD_FOLDER}} - - - name: Upload Executable Only - uses: actions/upload-artifact@v7 - if: inputs.upload-build && startsWith(inputs.os, 'windows') - with: - name: Standalone Executable (os=${{inputs.os}}) - path: ${{env.UPLOAD_FOLDER}}/SerialPrograms.exe - - - name: Checkout CommandLineTests - uses: actions/checkout@v7 - if: inputs.run-tests - with: - repository: 'PokemonAutomation/CommandLineTests' - path: 'CommandLineTests' - - - name: Run tests (Windows) - if: startsWith(inputs.os, 'windows') && inputs.run-tests - run: | - cd Arduino-Source/SerialPrograms/bin - $process = Start-Process -FilePath "./RelWithDebInfo/SerialPrograms.exe" ` - -ArgumentList "--command-line-test-mode --command-line-test-folder ../../../CommandLineTests" ` - -NoNewWindow -Wait -PassThru - if ($process.ExitCode -ne 0) { - Write-Error "Tests failed with exit code $($process.ExitCode)" + echo "UPLOAD_FOLDER=$UPLOAD_FOLDER" >> $GITHUB_ENV + + - name: Checkout Arduino-Source + uses: actions/checkout@v7 + with: + path: 'Arduino-Source' + submodules: 'recursive' + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + # Delete aqtsource once https://github.com/miurahr/aqtinstall/issues/1007 is fixed and released + aqtsource: 'git+https://github.com/miurahr/aqtinstall' + version: '6.10.2' + modules: 'qtmultimedia qtserialport' + + - name: Install dependencies (Ubuntu) + if: startsWith(inputs.os, 'ubuntu') + run: | + cd Arduino-Source + sudo apt update + sudo apt upgrade + sudo apt install clang-tools libopencv-dev libsystemd-dev + + sudo apt install ./3rdPartyBinaries/libdpp-10.1.5-linux-x64.deb + + - name: Install dependencies (Mac) + if: startsWith(inputs.os, 'mac') + run: | + cd Arduino-Source + brew install opencv@4 onnxruntime + + brew tap-new --no-git PA/libdpp + brew trust PA/libdpp + FORMULA_DIR="$(brew --repo PA/libdpp)/Formula" + mkdir -p "$FORMULA_DIR" + cp 3rdPartyBinaries/libdpp@10.1.5.rb "$FORMULA_DIR/" + brew install libdpp@10.1.5 + + - name: Generate binaries + run: | + cd Arduino-Source/SerialPrograms + mkdir bin + cd bin + cmake .. -DQT_MAJOR:STRING=6 ${{env.CMAKE_ADDITIONAL_FLAGS}} + cmake --build . --config RelWithDebInfo --parallel 10 + + - name: Prepare upload build + if: inputs.upload-build + shell: bash + run: | + { + echo "https://github.com/${{github.repository_owner}}/Arduino-Source/commit/$(git -C Arduino-Source rev-parse HEAD)" + echo "https://github.com/${{github.repository_owner}}/Packages/commit/$(git -C Arduino-Source/Packages rev-parse HEAD)" + } > ${{env.UPLOAD_FOLDER}}/version.txt + + - name: Upload Build + uses: actions/upload-artifact@v7 + if: inputs.upload-build + with: + name: Serial Programs (os=${{inputs.os}} - compiler=${{inputs.compiler}}) + path: ${{env.UPLOAD_FOLDER}} + + - name: Upload Executable Only + uses: actions/upload-artifact@v7 + if: inputs.upload-build && startsWith(inputs.os, 'windows') + with: + name: Standalone Executable (os=${{inputs.os}}) + path: ${{env.UPLOAD_FOLDER}}/SerialPrograms.exe + + - name: Checkout CommandLineTests + uses: actions/checkout@v7 + if: inputs.run-tests + with: + repository: 'PokemonAutomation/CommandLineTests' + path: 'CommandLineTests' + + - name: Run tests (Windows) + if: startsWith(inputs.os, 'windows') && inputs.run-tests + run: | + cd Arduino-Source/SerialPrograms/bin + $process = Start-Process -FilePath "./RelWithDebInfo/SerialPrograms.exe" ` + -ArgumentList "--command-line-test-mode --command-line-test-folder ../../../CommandLineTests" ` + -NoNewWindow -Wait -PassThru + if ($process.ExitCode -ne 0) { + Write-Error "Tests failed with exit code $($process.ExitCode)" + exit 1 + } + + - name: Run tests (Ubuntu) + if: startsWith(inputs.os, 'ubuntu') && inputs.run-tests + env: + QT_QPA_PLATFORM: offscreen + TESSDATA_PREFIX: ${{ github.workspace }}/Arduino-Source/SerialPrograms/bin/Resources/Tesseract + run: | + cd Arduino-Source/SerialPrograms/bin + ./SerialPrograms --command-line-test-mode --command-line-test-folder ../../../CommandLineTests + + - name: Run tests (Mac) + if: startsWith(inputs.os, 'mac') && inputs.run-tests + run: | + cd Arduino-Source/SerialPrograms/bin + ./SerialPrograms.app/Contents/MacOS/SerialPrograms --command-line-test-mode --command-line-test-folder ../../../CommandLineTests + + - name: Run clang query + if: inputs.run-clang-query + run : | + cd Arduino-Source + + cat << 'EOF' > query.txt + set output dump + match invocation( + isExpansionInFileMatching("SerialPrograms/"), + hasDeclaration(cxxConstructorDecl(ofClass(hasName("std::filesystem::path")))), + hasArgument(0, hasType(asString("std::string"))) + ) + EOF + + files=$(jq -r '.[].file' SerialPrograms/bin/compile_commands.json) + echo "$files" | xargs --max-args=150 clang-query -p SerialPrograms/bin/ -f query.txt >> output.txt + cat output.txt + if grep --silent "Match #" output.txt; then + echo "::error Forbidden std::filesystem::path construction detected!" exit 1 - } - - - name: Run tests (Mac) - if: startsWith(inputs.os, 'mac') && inputs.run-tests - run: | - cd Arduino-Source/SerialPrograms/bin - ./SerialPrograms.app/Contents/MacOS/SerialPrograms --command-line-test-mode --command-line-test-folder ../../../CommandLineTests - - - name: Run clang query - if: inputs.run-clang-query - run : | - cd Arduino-Source - - cat << 'EOF' > query.txt - set output dump - match invocation( - isExpansionInFileMatching("SerialPrograms/"), - hasDeclaration(cxxConstructorDecl(ofClass(hasName("std::filesystem::path")))), - hasArgument(0, hasType(asString("std::string"))) - ) - EOF - - files=$(jq -r '.[].file' SerialPrograms/bin/compile_commands.json) - echo "$files" | xargs --max-args=150 clang-query -p SerialPrograms/bin/ -f query.txt >> output.txt - cat output.txt - if grep --silent "Match #" output.txt; then - echo "::error Forbidden std::filesystem::path construction detected!" - exit 1 - fi + fi diff --git a/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml b/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml index 097ec3c442..8e4abbb2f5 100644 --- a/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml +++ b/.github/workflows/cpp-ci-serial-programs-ubuntu-clang.yml @@ -13,3 +13,4 @@ jobs: os: ubuntu-26.04 compiler: clang run-clang-query: true + run-tests: true diff --git a/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml b/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml index c3ebd5f69b..b84887ef05 100644 --- a/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml +++ b/.github/workflows/cpp-ci-serial-programs-ubuntu-default.yml @@ -13,3 +13,4 @@ jobs: os: ubuntu-26.04 compiler: default run-clang-query: true + run-tests: true