flipperzero-firmware/.github/workflows/pvs_studio.yml
hedger 224d0aefe4
[FL-2733] multitarget support for fbt (#2209)
* First part of multitarget porting
* Delete firmware/targets/f7/Inc directory
* Delete firmware/targets/f7/Src directory
* gpio: cli fixes; about: using version from HAL
* sdk: path fixes
* gui: include fixes
* applications: more include fixes
* gpio: ported to new apis
* hal: introduced furi_hal_target_hw.h; libs: added one_wire
* hal: f18 target
* github: also build f18 by default
* typo fix
* fbt: removed extra checks on app list
* api: explicitly bundling select mlib headers with sdk
* hal: f18: changed INPUT_DEBOUNCE_TICKS to match f7
* cleaned up commented out code
* docs: added info on hw targets
* docs: targets: formatting fixes
* f18: fixed link error
* f18: fixed API version to match f7
* docs: hardware: minor wording fixes
* faploader: added fw target check
* docs: typo fixes
* github: not building komi target by default
* fbt: support for `targets` field for built-in apps
* github: reworked build flow to exclude app_set; fbt: removed komi-specific appset; added additional target buildset check
* github: fixed build; nfc: fixed pvs warnings
* attempt to fix target id
* f7, f18: removed certain HAL function from public API
* apps: debug: enabled bt_debug_app for f18
* Targets: backport input pins configuration routine from F7 to F18

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-02-08 01:33:05 +09:00

95 lines
3.5 KiB
YAML

name: 'Static C/C++ analysis with PVS-Studio'
on:
push:
branches:
- dev
- "release*"
tags:
- '*'
pull_request:
env:
TARGETS: f7
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /runner/_work
jobs:
analyse_c_cpp:
if: ${{ !github.event.pull_request.head.repo.fork }}
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@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Get commit details'
id: names
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
TYPE="pull"
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
TYPE="tag"
else
TYPE="other"
fi
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
- name: 'Supply PVS credentials'
run: |
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
- name: 'Convert PVS-Studio output to html and detect warnings'
id: pvs-warn
run: |
WARNINGS=0
./fbt COMPACT=1 PVSNOBROWSER=1 firmware_pvs || WARNINGS=1
echo "warnings=${WARNINGS}" >> $GITHUB_OUTPUT
- name: 'Upload artifacts to update server'
if: ${{ !github.event.pull_request.head.repo.fork && (steps.pvs-warn.outputs.warnings != 0) }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -p ${{ secrets.RSYNC_DEPLOY_PORT }} -H ${{ secrets.RSYNC_DEPLOY_HOST }} > ~/.ssh/known_hosts
echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key;
chmod 600 ./deploy_key;
rsync -avrzP --mkpath \
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
build/f7-firmware-DC/pvsreport/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:/home/data/firmware-pvs-studio-report/"${BRANCH_NAME}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/";
rm ./deploy_key;
- name: 'Find Previous Comment'
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request && (steps.pvs-warn.outputs.warnings != 0) }}
uses: peter-evans/find-comment@v2
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 && (steps.pvs-warn.outputs.warnings != 0) }}
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.commit_sha}}`:**
- [Report](https://update.flipperzero.one/builds/firmware-pvs-studio-report/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/index.html)
edit-mode: replace
- name: 'Raise exception'
if: ${{ steps.pvs-warn.outputs.warnings != 0 }}
run: |
echo "Please fix all PVS warnings before merge"
exit 1