From cd44d09d84504f276fc872da11bf7d5f504e202c Mon Sep 17 00:00:00 2001 From: David Buzz Date: Mon, 8 Jan 2024 20:00:11 +1000 Subject: [PATCH] github: actions problem solvers , annotations and summary --- .github/problem-matchers/autotestfail.json | 17 +++++ .github/problem-matchers/autotestwarn.json | 17 +++++ .github/problem-matchers/gcc.json | 18 +++++ .github/problem-matchers/python.json | 22 +++++++ .github/workflows/esp32_build.yml | 76 +++++++++++++++------- 5 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 .github/problem-matchers/autotestfail.json create mode 100644 .github/problem-matchers/autotestwarn.json create mode 100644 .github/problem-matchers/gcc.json create mode 100644 .github/problem-matchers/python.json diff --git a/.github/problem-matchers/autotestfail.json b/.github/problem-matchers/autotestfail.json new file mode 100644 index 0000000000..ccda5c1a94 --- /dev/null +++ b/.github/problem-matchers/autotestfail.json @@ -0,0 +1,17 @@ +{ + "__comment": "by buzz try to match common autotest warnings and errors that arent caught by gcc.json or python.json", + "problemMatcher": [ + { + "owner": "autotest-fail-matcher", + "severity": "error", + "pattern": [ + { + "regexp": "^(.*)(TIMEOUT|Build failed|FAILED STEP):(.*)$", + "column": 1, + "code": 2, + "message": 3 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/problem-matchers/autotestwarn.json b/.github/problem-matchers/autotestwarn.json new file mode 100644 index 0000000000..6aa77a7ece --- /dev/null +++ b/.github/problem-matchers/autotestwarn.json @@ -0,0 +1,17 @@ +{ + "__comment": "by buzz try to match common autotest warnings and errors that arent caught by gcc.json or python.json", + "problemMatcher": [ + { + "owner": "autotest-warn-matcher", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.*)(WARN|WARNING):(.*)$", + "column": 1, + "code": 2, + "message": 3 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/problem-matchers/gcc.json b/.github/problem-matchers/gcc.json new file mode 100644 index 0000000000..bd5ab6c00a --- /dev/null +++ b/.github/problem-matchers/gcc.json @@ -0,0 +1,18 @@ +{ + "__comment": "Taken from vscode-cpptools's Extension/package.json gcc rule", + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/problem-matchers/python.json b/.github/problem-matchers/python.json new file mode 100644 index 0000000000..a14ab2dd76 --- /dev/null +++ b/.github/problem-matchers/python.json @@ -0,0 +1,22 @@ +{ + "__comment": "inspired by https://github.com/microsoft/vscode-python/issues/3828#issuecomment-575439587", + "problemMatcher": [ + { + "owner": "python-problem-matcher", + "pattern": [ + { + "regexp": "^.*File \\\"([^\\\"]|.*)\\\", line (\\d+).*", + "file": 1, + "line": 2 + }, + { + "regexp": "^.*raise.*$" + }, + { + "regexp": "^\\s*(.*)\\s*$", + "message": 1 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/esp32_build.yml b/.github/workflows/esp32_build.yml index 7f2a11bf06..26185663fe 100644 --- a/.github/workflows/esp32_build.yml +++ b/.github/workflows/esp32_build.yml @@ -151,6 +151,7 @@ jobs: matrix: config: [ esp32buzz, + esp32s3empty, ] gcc: [10] @@ -158,6 +159,19 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'recursive' + + - name: Register gcc problem matcher + run: echo "::add-matcher::.github/problem-matchers/gcc.json" + + - name: Register python problem matcher + run: echo "::add-matcher::.github/problem-matchers/python.json" + + - name: Register autotest warn matcher + run: echo "::add-matcher::.github/problem-matchers/autotestwarn.json" + + - name: Register autotest fail matcher + run: echo "::add-matcher::.github/problem-matchers/autotestfail.json" + - name: Install Prerequisites shell: bash run: | @@ -169,8 +183,8 @@ jobs: # we actualy want 3.11 .. but the above only gave us 3.10, not ok with esp32 builds. sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt update - sudo apt install python3.11 python3.11-venv python3.11-distutils -y + sudo apt-get update + sudo apt-get install python3.11 python3.11-venv python3.11-distutils -y sudo apt-get install python3 python3-pip python3-venv python3-setuptools python3-serial python3-cryptography python3-future python3-pyparsing python3-pyelftools update-alternatives --query python pip3 install gevent @@ -181,14 +195,14 @@ jobs: update-alternatives --query python rm -rf /usr/local/bin/cmake - sudo apt remove --purge --auto-remove cmake - sudo apt update && \ - sudo apt install -y software-properties-common lsb-release && \ - sudo apt clean all + sudo apt-get remove --purge --auto-remove cmake + sudo apt-get update && \ + sudo apt-get install -y software-properties-common lsb-release && \ + sudo apt-get clean all wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" - sudo apt update - sudo apt install cmake + sudo apt-get update + sudo apt-get install cmake git submodule update --init --recursive --depth=1 @@ -198,7 +212,7 @@ jobs: cd modules/esp_idf echo "Installing ESP-IDF tools...." - ./install.sh esp32,esp32s3 2>&1 > /dev/null + ./install.sh esp32,esp32s3 cd ../.. @@ -210,32 +224,48 @@ jobs: source ~/.bash_profile PATH="/github/home/.local/bin:$PATH" echo $PATH - + echo "### Configure ${{matrix.config}} :rocket:" >> $GITHUB_STEP_SUMMARY cd modules/esp_idf ./install.sh source ./export.sh cd ../.. python -m pip install --progress-bar off future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan which cmake - ./waf configure --board ${{matrix.config}} - ./waf plane - cp build/esp32buzz/esp-idf_build/ardupilot.bin ./ArduPlane.bin - cp build/esp32buzz/esp-idf_build/ardupilot.elf ./ArduPlane.elf - ./waf copter - cp build/esp32buzz/esp-idf_build/ardupilot.bin ./ArduCopter.bin - cp build/esp32buzz/esp-idf_build/ardupilot.elf ./ArduCopter.elf + ./waf configure --board ${{matrix.config}} + echo './waf configure --board ${{matrix.config}}' >> $GITHUB_STEP_SUMMARY + echo "### Build Plane ${{matrix.config}} :rocket:" >> $GITHUB_STEP_SUMMARY + echo './waf plane' >> $GITHUB_STEP_SUMMARY + ./waf plane | tee >( grep -vE 'Compiling|Generat|includes.list|Parsing|Validation|Building|Linking|Detecting|linker|\*\*\*\*\*\*\*|Partition|SubType|Checking|esp-idf' --color=never --line-buffered > summary.log) + cat summary.log >> $GITHUB_STEP_SUMMARY + + cp build/${{matrix.config}}/esp-idf_build/ardupilot.bin ./ArduPlane.${{matrix.config}}.bin + cp build/${{matrix.config}}/esp-idf_build/ardupilot.elf ./ArduPlane.${{matrix.config}}.elf + echo "### Build Copter ${{matrix.config}} :rocket:" >> $GITHUB_STEP_SUMMARY + echo './waf copter' >> $GITHUB_STEP_SUMMARY + ./waf copter | tee >( grep -vE 'Compiling|Generat|includes.list|Parsing|Validation|Building|Linking|Detecting|linker|\*\*\*\*\*\*\*|Partition|SubType|Checking|esp-idf' --color=never --line-buffered > summary2.log) + + cat summary2.log >> $GITHUB_STEP_SUMMARY + + cp build/${{matrix.config}}/esp-idf_build/ardupilot.bin ./ArduCopter.${{matrix.config}}.bin + cp build/${{matrix.config}}/esp-idf_build/ardupilot.elf ./ArduCopter.${{matrix.config}}.elf + + cp build/${{matrix.config}}/esp-idf_build/bootloader/bootloader.bin ./bootloader.${{matrix.config}}.bin + cp build/${{matrix.config}}/esp-idf_build/partition_table/partition-table.bin ./partition-table.${{matrix.config}}.bin + + echo "### Assets avail in artifact:" >> $GITHUB_STEP_SUMMARY + ls bootloader* partition* Ardu*.elf Ardu*.bin >> $GITHUB_STEP_SUMMARY - name: Archive artifacts uses: actions/upload-artifact@v3 with: name: esp32-binaries -${{matrix.config}} path: | - /home/runner/work/ardupilot/ardupilot/ArduPlane.bin - /home/runner/work/ardupilot/ardupilot/ArduPlane.elf - /home/runner/work/ardupilot/ardupilot/ArduCopter.bin - /home/runner/work/ardupilot/ardupilot/ArduCopter.elf - /home/runner/work/ardupilot/ardupilot/build/esp32buzz/esp-idf_build/bootloader/bootloader.bin - /home/runner/work/ardupilot/ardupilot/build/esp32buzz/esp-idf_build/partition_table/partition-table.bin + /home/runner/work/ardupilot/ardupilot/ArduPlane.${{matrix.config}}.bin + /home/runner/work/ardupilot/ardupilot/ArduPlane.${{matrix.config}}.elf + /home/runner/work/ardupilot/ardupilot/ArduCopter.${{matrix.config}}.bin + /home/runner/work/ardupilot/ardupilot/ArduCopter.${{matrix.config}}.elf + /home/runner/work/ardupilot/ardupilot/bootloader.${{matrix.config}}.bin + /home/runner/work/ardupilot/ardupilot/partition-table.${{matrix.config}}.bin retention-days: 14