forked from flipperdevices/flipperzero-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release-candidate' into release
- Loading branch information
Showing
351 changed files
with
14,040 additions
and
6,413 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: 'Analyze .map file with Amap' | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- "release*" | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
env: | ||
TARGETS: f7 | ||
|
||
jobs: | ||
amap_analyse: | ||
runs-on: [self-hosted,FlipperZeroMacShell] | ||
timeout-minutes: 15 | ||
steps: | ||
- name: 'Wait Build workflow' | ||
uses: fountainhead/action-wait-for-check@v1.0.0 | ||
id: wait-for-build | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
checkName: 'main' | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
intervalSeconds: 20 | ||
|
||
- name: 'Check Build workflow status' | ||
if: steps.wait-for-build.outputs.conclusion == 'failure' | ||
run: | | ||
exit 1 | ||
- name: 'Decontaminate previous build leftovers' | ||
run: | | ||
if [ -d .git ]; then | ||
git submodule status \ | ||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1` | ||
fi | ||
- name: 'Checkout code' | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: 'Generate prefixes by commit' | ||
id: names | ||
run: | | ||
REF="${{github.ref}}" | ||
COMMIT_HASH="$(git rev-parse HEAD)" | ||
SHA="$(git rev-parse --short HEAD)" | ||
COMMIT_MSG="${{github.event.head_commit.message}}" | ||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then | ||
REF="${{github.head_ref}}" | ||
COMMIT_HASH="$(git log -1 --pretty=oneline | awk '{print $1}')" | ||
SHA="$(cut -c -8 <<< "$COMMIT_HASH")" | ||
COMMIT_MSG="$(git log -1 --pretty=format:"%s")" | ||
PULL_ID="${{github.event.pull_request.number}}" | ||
PULL_NAME="${{github.event.pull_request.title}}" | ||
fi | ||
BRANCH_NAME=${REF#refs/*/} | ||
SUFFIX=${BRANCH_NAME//\//_}-$(date +'%d%m%Y')-${SHA} | ||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | ||
SUFFIX=${BRANCH_NAME//\//_} | ||
fi | ||
echo "::set-output name=commit-hash::${COMMIT_HASH}" | ||
echo "::set-output name=commit-msg::${COMMIT_MSG}" | ||
echo "::set-output name=pull-id::${PULL_ID}" | ||
echo "::set-output name=pull-name::${PULL_NAME}" | ||
echo "::set-output name=branch-name::${BRANCH_NAME}" | ||
echo "::set-output name=suffix::${SUFFIX}" | ||
- name: 'Make artifacts directory' | ||
run: | | ||
rm -rf artifacts | ||
mkdir artifacts | ||
- name: 'Download build artifacts' | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
run: | | ||
echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key; | ||
chmod 600 ./deploy_key; | ||
rsync -avzP \ | ||
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \ | ||
${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${{steps.names.outputs.branch-name}}/" artifacts/; | ||
rm ./deploy_key; | ||
- name: 'Make .map file analyze' | ||
run: | | ||
cd artifacts/ | ||
/Applications/amap/Contents/MacOS/amap -f flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf.map | ||
- name: 'Upload report to DB' | ||
run: | | ||
FBT_TOOLCHAIN_PATH=/opt source scripts/toolchain/fbtenv.sh | ||
get_size() | ||
{ | ||
SECTION="$1"; | ||
arm-none-eabi-size \ | ||
-A artifacts/flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf \ | ||
| grep "^$SECTION" | awk '{print $2}' | ||
} | ||
export COMMIT_HASH="${{steps.names.outputs.commit-hash}}" | ||
export COMMIT_MSG="${{steps.names.outputs.commit-msg}}" | ||
export BRANCH_NAME="${{steps.names.outputs.branch-name}}" | ||
export BSS_SIZE="$(get_size ".bss")" | ||
export TEXT_SIZE="$(get_size ".text")" | ||
export RODATA_SIZE="$(get_size ".rodata")" | ||
export DATA_SIZE="$(get_size ".data")" | ||
export FREE_FLASH_SIZE="$(get_size ".free_flash")" | ||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then | ||
export PULL_ID="${{steps.names.outputs.pull-id}}" | ||
export PULL_NAME="${{steps.names.outputs.pull-name}}" | ||
fi | ||
python3 -m pip install mariadb | ||
python3 scripts/amap_mariadb_insert.py \ | ||
${{ secrets.AMAP_MARIADB_USER }} \ | ||
${{ secrets.AMAP_MARIADB_PASSWORD }} \ | ||
${{ secrets.AMAP_MARIADB_HOST }} \ | ||
${{ secrets.AMAP_MARIADB_PORT }} \ | ||
${{ secrets.AMAP_MARIADB_DATABASE }} \ | ||
artifacts/flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf.map.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: 'Static C/C++ analysis with PVS-Studio' | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- "release*" | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
env: | ||
TARGETS: f7 | ||
DEFAULT_TARGET: f7 | ||
|
||
jobs: | ||
analyse_c_cpp: | ||
runs-on: [self-hosted, FlipperZeroShell] | ||
steps: | ||
- name: 'Decontaminate previous build leftovers' | ||
run: | | ||
if [ -d .git ] | ||
then | ||
git submodule status \ | ||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1` | ||
fi | ||
- name: 'Checkout code' | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: 'Generate suffix and folder name' | ||
id: names | ||
run: | | ||
REF=${{ github.ref }} | ||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then | ||
REF=${{ github.head_ref }} | ||
fi | ||
BRANCH_OR_TAG=${REF#refs/*/} | ||
SHA=$(git rev-parse --short HEAD) | ||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | ||
SUFFIX=${BRANCH_OR_TAG//\//_} | ||
else | ||
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA} | ||
fi | ||
echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV | ||
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV | ||
echo "::set-output name=artifacts-path::${BRANCH_OR_TAG}" | ||
echo "::set-output name=suffix::${SUFFIX}" | ||
echo "::set-output name=short-hash::${SHA}" | ||
echo "::set-output name=default-target::${DEFAULT_TARGET}" | ||
- name: 'Make reports directory' | ||
run: | | ||
rm -rf reports/ | ||
mkdir reports | ||
- name: 'Generate compile_comands.json' | ||
run: | | ||
FBT_TOOLCHAIN_PATH=/opt ./fbt COMPACT=1 version_json proto_ver icons firmware_cdb dolphin_internal dolphin_blocking | ||
- name: 'Static code analysis' | ||
run: | | ||
FBT_TOOLCHAIN_PATH=/opt source scripts/toolchain/fbtenv.sh | ||
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }} | ||
pvs-studio-analyzer analyze \ | ||
@.pvsoptions \ | ||
-j$(grep -c processor /proc/cpuinfo) \ | ||
-f build/f7-firmware-DC/compile_commands.json \ | ||
-o PVS-Studio.log | ||
- name: 'Convert PVS-Studio output to html page' | ||
run: plog-converter -a GA:1,2,3 -t fullhtml PVS-Studio.log -o reports/${{steps.names.outputs.default-target}}-${{steps.names.outputs.suffix}} | ||
|
||
- name: 'Upload artifacts to update server' | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
run: | | ||
echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key; | ||
chmod 600 ./deploy_key; | ||
rsync -avrzP --mkpath \ | ||
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \ | ||
reports/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:/home/data/firmware-pvs-studio-report/"${{steps.names.outputs.artifacts-path}}/"; | ||
rm ./deploy_key; | ||
- name: 'Find Previous Comment' | ||
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request }} | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: 'PVS-Studio report for commit' | ||
|
||
- name: 'Create or update comment' | ||
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request}} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
**PVS-Studio report for commit `${{steps.names.outputs.short-hash}}`:** | ||
- [Report](https://update.flipperzero.one/builds/firmware-pvs-studio-report/${{steps.names.outputs.artifacts-path}}/${{steps.names.outputs.default-target}}-${{steps.names.outputs.suffix}}/index.html) | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,7 @@ build/ | |
|
||
# openocd output file | ||
openocd.log | ||
|
||
# PVS Studio temporary files | ||
.PVS-Studio/ | ||
PVS-Studio.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# MLib macros we can't do much about. | ||
//-V:M_EACH:1048,1044 | ||
//-V:ARRAY_DEF:760,747,568,776,729,712,654 | ||
//-V:LIST_DEF:760,747,568,712,729,654,776 | ||
//-V:BPTREE_DEF2:779,1086,557,773,512 | ||
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685 | ||
//-V:ALGO_DEF:1048,747,1044 | ||
|
||
# Non-severe malloc/null pointer deref warnings | ||
//-V::522:2,3 | ||
|
||
# Warning about headers with copyleft license | ||
//-V::1042 | ||
|
||
# Potentially null argument warnings | ||
//-V:memset:575 | ||
//-V:memcpy:575 | ||
//-V:strcpy:575 | ||
//-V:strchr:575 | ||
|
||
# For loop warning on M_FOREACH | ||
//-V:for:1044 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--rules-config .pvsconfig -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e */arm-none-eabi/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.