github: actions problem solvers , annotations and summary

This commit is contained in:
David Buzz 2024-01-08 20:00:11 +10:00 committed by Peter Barker
parent 5dbe08c454
commit cd44d09d84
5 changed files with 127 additions and 23 deletions

View File

@ -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
}
]
}
]
}

View File

@ -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
}
]
}
]
}

18
.github/problem-matchers/gcc.json vendored Normal file
View File

@ -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
}
]
}
]
}

22
.github/problem-matchers/python.json vendored Normal file
View File

@ -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
}
]
}
]
}

View File

@ -151,6 +151,7 @@ jobs:
matrix: matrix:
config: [ config: [
esp32buzz, esp32buzz,
esp32s3empty,
] ]
gcc: [10] gcc: [10]
@ -158,6 +159,19 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: 'recursive' 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 - name: Install Prerequisites
shell: bash shell: bash
run: | run: |
@ -169,8 +183,8 @@ jobs:
# we actualy want 3.11 .. but the above only gave us 3.10, not ok with esp32 builds. # 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 add-apt-repository ppa:deadsnakes/ppa
sudo apt update sudo apt-get update
sudo apt install python3.11 python3.11-venv python3.11-distutils -y 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 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 update-alternatives --query python
pip3 install gevent pip3 install gevent
@ -181,14 +195,14 @@ jobs:
update-alternatives --query python update-alternatives --query python
rm -rf /usr/local/bin/cmake rm -rf /usr/local/bin/cmake
sudo apt remove --purge --auto-remove cmake sudo apt-get remove --purge --auto-remove cmake
sudo apt update && \ sudo apt-get update && \
sudo apt install -y software-properties-common lsb-release && \ sudo apt-get install -y software-properties-common lsb-release && \
sudo apt clean all 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 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-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
sudo apt update sudo apt-get update
sudo apt install cmake sudo apt-get install cmake
git submodule update --init --recursive --depth=1 git submodule update --init --recursive --depth=1
@ -198,7 +212,7 @@ jobs:
cd modules/esp_idf cd modules/esp_idf
echo "Installing ESP-IDF tools...." echo "Installing ESP-IDF tools...."
./install.sh esp32,esp32s3 2>&1 > /dev/null ./install.sh esp32,esp32s3
cd ../.. cd ../..
@ -210,7 +224,7 @@ jobs:
source ~/.bash_profile source ~/.bash_profile
PATH="/github/home/.local/bin:$PATH" PATH="/github/home/.local/bin:$PATH"
echo $PATH echo $PATH
echo "### Configure ${{matrix.config}} :rocket:" >> $GITHUB_STEP_SUMMARY
cd modules/esp_idf cd modules/esp_idf
./install.sh ./install.sh
source ./export.sh source ./export.sh
@ -218,24 +232,40 @@ jobs:
python -m pip install --progress-bar off future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan python -m pip install --progress-bar off future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan
which cmake which cmake
./waf configure --board ${{matrix.config}} ./waf configure --board ${{matrix.config}}
./waf plane echo './waf configure --board ${{matrix.config}}' >> $GITHUB_STEP_SUMMARY
cp build/esp32buzz/esp-idf_build/ardupilot.bin ./ArduPlane.bin echo "### Build Plane ${{matrix.config}} :rocket:" >> $GITHUB_STEP_SUMMARY
cp build/esp32buzz/esp-idf_build/ardupilot.elf ./ArduPlane.elf echo './waf plane' >> $GITHUB_STEP_SUMMARY
./waf copter ./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)
cp build/esp32buzz/esp-idf_build/ardupilot.bin ./ArduCopter.bin cat summary.log >> $GITHUB_STEP_SUMMARY
cp build/esp32buzz/esp-idf_build/ardupilot.elf ./ArduCopter.elf
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 - name: Archive artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: esp32-binaries -${{matrix.config}} name: esp32-binaries -${{matrix.config}}
path: | path: |
/home/runner/work/ardupilot/ardupilot/ArduPlane.bin /home/runner/work/ardupilot/ardupilot/ArduPlane.${{matrix.config}}.bin
/home/runner/work/ardupilot/ardupilot/ArduPlane.elf /home/runner/work/ardupilot/ardupilot/ArduPlane.${{matrix.config}}.elf
/home/runner/work/ardupilot/ardupilot/ArduCopter.bin /home/runner/work/ardupilot/ardupilot/ArduCopter.${{matrix.config}}.bin
/home/runner/work/ardupilot/ardupilot/ArduCopter.elf /home/runner/work/ardupilot/ardupilot/ArduCopter.${{matrix.config}}.elf
/home/runner/work/ardupilot/ardupilot/build/esp32buzz/esp-idf_build/bootloader/bootloader.bin /home/runner/work/ardupilot/ardupilot/bootloader.${{matrix.config}}.bin
/home/runner/work/ardupilot/ardupilot/build/esp32buzz/esp-idf_build/partition_table/partition-table.bin /home/runner/work/ardupilot/ardupilot/partition-table.${{matrix.config}}.bin
retention-days: 14 retention-days: 14