Skip to content

Commit

Permalink
🔖 (v1.3.0): Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Jan 13, 2023
2 parents 7e5bda9 + 8646e48 commit 5a49826
Show file tree
Hide file tree
Showing 314 changed files with 28,302 additions and 1,514 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IncludeCategories:
- Regex: '(<|"mbed)'
Priority: 0
SortPriority: 0
- Regex: '"(drivers|rtos|events|platform)'
- Regex: '"(drivers|rtos|events|platform|hal)'
Priority: 2
SortPriority: 0
- Regex: "PinNames.h"
Expand Down
8 changes: 7 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ CheckOptions:
- key: readability-function-cognitive-complexity.IgnoreMacros
value: true
- key: readability-magic-numbers.IgnoredIntegerValues
value: "1;2;3;4;10;100;1000;60;3600;9600;115200;128;255"
value: "1;2;3;4;10;100;1000;60;80;3600;9600;57600;115200;128;255;1000000"
- key: readability-identifier-length.IgnoredVariableNames
value: "^(fs|c|ms|fh|t|bd|s|hz|id|[abcijkxyz])$"
- key: readability-identifier-length.IgnoredParameterNames
value: "^(fs|c|ms|fh|t|bd|s|hz|id|[abcijkxyz])$"
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: true

WarningsAsErrors: " \
modernize-*
Expand Down
7 changes: 2 additions & 5 deletions .github/actions/compare_files/compare_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for target in "${all_targets[@]}"; do
if [ $diff_flash -lt 0 ]; then
output_flash_delta=":chart_with_downwards_trend:<br>$diff_flash&nbsp;($diff_flash_percentage)"
elif [ $diff_flash -gt 0 ]; then
output_flash_delta=":chart_with_upwards_trend:<br>$diff_flash&nbsp;($diff_flash_percentage)"
output_flash_delta=":chart_with_upwards_trend:<br>+$diff_flash&nbsp;(+$diff_flash_percentage)"
else
output_flash="$base_flash_with_percentage"
output_flash_delta="ø"
Expand All @@ -82,9 +82,6 @@ for target in "${all_targets[@]}"; do
base_ram_with_percentage="$(getUsedRamSizeWithPercentage $BASE_DIR $target_name)"
head_ram_with_percentage="$(getUsedRamSizeWithPercentage $HEAD_DIR $target_name)"

base_ram_percentage=$(grep -Po '(?<=SRAM used:\s)[[:digit:]]*\s\([[:digit:]]*%\)' $BASE_DIR/$target_name-code_size.txt)
head_ram_percentage=$(grep -Po '(?<=SRAM used:\s)[[:digit:]]*\s\([[:digit:]]*%\)' $HEAD_DIR/$target_name-code_size.txt)

base_ram="$(getUsedRamSize $BASE_DIR $target_name)"
head_ram="$(getUsedRamSize $HEAD_DIR $target_name)"

Expand All @@ -97,7 +94,7 @@ for target in "${all_targets[@]}"; do
if [ $diff_ram -lt 0 ]; then
output_ram_delta=":chart_with_downwards_trend:<br>$diff_ram&nbsp;($diff_ram_percentage)"
elif [ $diff_ram -gt 0 ]; then
output_ram_delta=":chart_with_upwards_trend:<br>$diff_ram&nbsp;($diff_ram_percentage)"
output_ram_delta=":chart_with_upwards_trend:<br>+$diff_ram&nbsp;(+$diff_ram_percentage)"
else
output_ram="$base_ram_with_percentage"
output_ram_delta="ø"
Expand Down
125 changes: 115 additions & 10 deletions .github/actions/compare_files/generate_statistics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,72 @@ echo "Creating statistics for bootloader"
bootloader_target_name="bootloader"
bootloader_memory_section_size="0x40000"

createSizeTextFile $BASE_DIR $bootloader_target_name
createSizeTextFile $HEAD_DIR $bootloader_target_name

# MARK: Flash Used
bootloader_base_flash_used="$(getUsedFlashSize $BASE_DIR $bootloader_target_name)"
bootloader_base_flash_used_percentage="$((100 * $bootloader_base_flash_used / $bootloader_memory_section_size))%"

bootloader_head_flash_used="$(getUsedFlashSize $HEAD_DIR $bootloader_target_name)"
bootloader_head_flash_used_percentage="$((100 * $bootloader_head_flash_used / $bootloader_memory_section_size))%"

output_bootloader_flash_used="$bootloader_head_flash_used&nbsp;($bootloader_head_flash_used_percentage)"
output_bootloader_base_flash_used="$bootloader_base_flash_used&nbsp;($bootloader_base_flash_used_percentage)"
output_bootloader_head_flash_used="$bootloader_head_flash_used&nbsp;($bootloader_head_flash_used_percentage)"

OUTPUT_BOOTLOADER_FLASH_USED="$output_bootloader_base_flash_used<br>$output_bootloader_head_flash_used"

# MARK: Flash Used Delta
bootloader_diff_flash=$(($bootloader_head_flash_used - $bootloader_base_flash_used))
bootloader_diff_flash_percentage="$((100 * ($bootloader_head_flash_used - $bootloader_base_flash_used) / $bootloader_base_flash_used))%"

OUTPUT_BOOTLOADER_FLASH_USED_DELTA=""

if [ $bootloader_diff_flash -lt 0 ]; then
OUTPUT_BOOTLOADER_FLASH_USED_DELTA=":chart_with_downwards_trend:<br>$bootloader_diff_flash&nbsp;($bootloader_diff_flash_percentage)"
elif [ $bootloader_diff_flash -gt 0 ]; then
OUTPUT_BOOTLOADER_FLASH_USED_DELTA=":chart_with_upwards_trend:<br>+$bootloader_diff_flash&nbsp;(+$bootloader_diff_flash_percentage)"
else
OUTPUT_BOOTLOADER_FLASH_USED="$output_bootloader_base_flash_used"
OUTPUT_BOOTLOADER_FLASH_USED_DELTA="ø"
fi

# MARK: Flash Available
bootloader_base_flash_available="$(($bootloader_memory_section_size - $bootloader_base_flash_used))"
bootloader_base_flash_available_percentage="$((100 * $bootloader_base_flash_available / $bootloader_memory_section_size))%"

bootloader_head_flash_available="$(($bootloader_memory_section_size - $bootloader_head_flash_used))"
bootloader_head_flash_available_percentage="$((100 * $bootloader_head_flash_available / $bootloader_memory_section_size))%"

output_bootloader_flash_available="$bootloader_head_flash_available&nbsp;($bootloader_head_flash_available_percentage)"
output_bootloader_base_flash_available="$bootloader_base_flash_available&nbsp;($bootloader_base_flash_available_percentage)"
output_bootloader_head_flash_available="$bootloader_head_flash_available&nbsp;($bootloader_head_flash_available_percentage)"

OUTPUT_BOOTLOADER_FLASH_AVAILABLE="$output_bootloader_base_flash_available<br>$output_bootloader_head_flash_available"

# MARK: Static RAM
output_bootloader_base_ram_with_percentage="$(getUsedRamSizeWithPercentage $BASE_DIR $bootloader_target_name)"
output_bootloader_head_ram_with_percentage="$(getUsedRamSizeWithPercentage $HEAD_DIR $bootloader_target_name)"

OUTPUT_BOOTLOADER_RAM="$output_bootloader_base_ram_with_percentage<br>$output_bootloader_head_ram_with_percentage"

# MARK: Static RAM Delta

bootloader_base_ram="$(getUsedRamSize $BASE_DIR $bootloader_target_name)"
bootloader_head_ram="$(getUsedRamSize $HEAD_DIR $bootloader_target_name)"

bootloader_diff_ram=$(($bootloader_head_ram - $bootloader_base_ram))
bootloader_diff_ram_percentage="$((100 * ($bootloader_head_ram - $bootloader_base_ram) / $bootloader_base_ram))%"

OUTPUT_BOOTLOADER_RAM_DELTA=""

output_booloader_ram_with_percentage="$(getUsedRamSizeWithPercentage $HEAD_DIR $bootloader_target_name)"
if [ $bootloader_diff_ram -lt 0 ]; then
OUTPUT_BOOTLOADER_RAM_DELTA=":chart_with_downwards_trend:<br>$bootloader_diff_ram&nbsp;($bootloader_diff_ram_percentage)"
elif [ $bootloader_diff_ram -gt 0 ]; then
OUTPUT_BOOTLOADER_RAM_DELTA=":chart_with_upwards_trend:<br>+$bootloader_diff_ram&nbsp;(+$bootloader_diff_ram_percentage)"
else
OUTPUT_BOOTLOADER_RAM="$output_bootloader_base_ram_with_percentage"
OUTPUT_BOOTLOADER_RAM_DELTA="ø"
fi

#
# MARK: - os statistics
Expand All @@ -41,19 +94,71 @@ echo "Creating statistics for os"
leka_os_target_name="LekaOS"
leka_os_memory_section_size="0x17E000"

createSizeTextFile $BASE_DIR $leka_os_target_name
createSizeTextFile $HEAD_DIR $leka_os_target_name

# MARK: Flash Used
leka_os_base_flash_used="$(getUsedFlashSize $BASE_DIR $leka_os_target_name)"
leka_os_base_flash_used_percentage="$((100 * $leka_os_base_flash_used / $leka_os_memory_section_size))%"

leka_os_head_flash_used="$(getUsedFlashSize $HEAD_DIR $leka_os_target_name)"
leka_os_head_flash_used_percentage="$((100 * $leka_os_head_flash_used / $leka_os_memory_section_size))%"

output_leka_os_flash_used="$leka_os_head_flash_used&nbsp;($leka_os_head_flash_used_percentage)"
output_leka_os_base_flash_used="$leka_os_base_flash_used&nbsp;($leka_os_base_flash_used_percentage)"
output_leka_os_head_flash_used="$leka_os_head_flash_used&nbsp;($leka_os_head_flash_used_percentage)"

OUTPUT_LEKA_OS_FLASH_USED="$output_leka_os_base_flash_used<br>$output_leka_os_head_flash_used"

# MARK: Flash Used Delta
leka_os_diff_flash=$(($leka_os_head_flash_used - $leka_os_base_flash_used))
leka_os_diff_flash_percentage="$((100 * ($leka_os_head_flash_used - $leka_os_base_flash_used) / $leka_os_base_flash_used))%"

OUTPUT_LEKA_OS_FLASH_USED_DELTA=""

if [ $leka_os_diff_flash -lt 0 ]; then
OUTPUT_LEKA_OS_FLASH_USED_DELTA=":chart_with_downwards_trend:<br>$leka_os_diff_flash&nbsp;($leka_os_diff_flash_percentage)"
elif [ $leka_os_diff_flash -gt 0 ]; then
OUTPUT_LEKA_OS_FLASH_USED_DELTA=":chart_with_upwards_trend:<br>+$leka_os_diff_flash&nbsp;(+$leka_os_diff_flash_percentage)"
else
OUTPUT_LEKA_OS_FLASH_USED="$output_leka_os_base_flash_used"
OUTPUT_LEKA_OS_FLASH_USED_DELTA="ø"
fi

# MARK: Flash Available
leka_os_base_flash_available="$(($leka_os_memory_section_size - $leka_os_base_flash_used))"
leka_os_base_flash_available_percentage="$((100 * $leka_os_base_flash_available / $leka_os_memory_section_size))%"

leka_os_head_flash_available="$(($leka_os_memory_section_size - $leka_os_head_flash_used))"
leka_os_head_flash_available_percentage="$((100 * $leka_os_head_flash_available / $leka_os_memory_section_size))%"

output_leka_os_flash_available="$leka_os_head_flash_available&nbsp;($leka_os_head_flash_available_percentage)"
output_leka_os_base_flash_available="$leka_os_base_flash_available&nbsp;($leka_os_base_flash_available_percentage)"
output_leka_os_head_flash_available="$leka_os_head_flash_available&nbsp;($leka_os_head_flash_available_percentage)"

OUTPUT_LEKA_OS_FLASH_AVAILABLE="$output_leka_os_base_flash_available<br>$output_leka_os_head_flash_available"

# MARK: Static RAM
output_leka_os_base_ram_with_percentage="$(getUsedRamSizeWithPercentage $BASE_DIR $leka_os_target_name)"
output_leka_os_head_ram_with_percentage="$(getUsedRamSizeWithPercentage $HEAD_DIR $leka_os_target_name)"

OUTPUT_LEKA_OS_RAM="$output_leka_os_base_ram_with_percentage<br>$output_leka_os_head_ram_with_percentage"

# MARK: Static RAM Delta
leka_os_base_ram="$(getUsedRamSize $BASE_DIR $leka_os_target_name)"
leka_os_head_ram="$(getUsedRamSize $HEAD_DIR $leka_os_target_name)"

leka_os_diff_ram=$(($leka_os_head_ram - $leka_os_base_ram))
leka_os_diff_ram_percentage="$((100 * ($leka_os_head_ram - $leka_os_base_ram) / $leka_os_base_ram))%"

OUTPUT_LEKA_OS_RAM_DELTA=""

output_leka_os_ram_with_percentage="$(getUsedRamSizeWithPercentage $HEAD_DIR $leka_os_target_name)"
if [ $leka_os_diff_ram -lt 0 ]; then
OUTPUT_LEKA_OS_RAM_DELTA=":chart_with_downwards_trend:<br>$leka_os_diff_ram&nbsp;($leka_os_diff_ram_percentage)"
elif [ $leka_os_diff_ram -gt 0 ]; then
OUTPUT_LEKA_OS_RAM_DELTA=":chart_with_upwards_trend:<br>+$leka_os_diff_ram&nbsp;(+$leka_os_diff_ram_percentage)"
else
OUTPUT_LEKA_OS_RAM="$output_leka_os_base_ram_with_percentage"
OUTPUT_LEKA_OS_RAM_DELTA="ø"
fi

#
# MARK: - markdown output
Expand All @@ -63,10 +168,10 @@ echo "Creating markdown output"

echo 'FIRMWARE_STATISTICS_OUTPUT<<EOF_FIRMWARE_STATISTICS_OUTPUT' >> $GITHUB_ENV

echo -n "| Target | Flash Used (%) | Flash Available (%) | Static RAM (%) |\n" >> $GITHUB_ENV
echo -n "|--------|---------------:|--------------------:|---------------:|\n" >> $GITHUB_ENV
echo -n "| Target | Flash Used (base/head) | Fash Used Δ | Flash Available (base/head) | Static RAM (base/head) | Static RAM Δ |\n" >> $GITHUB_ENV
echo -n "|--------|:----------------------:|:-----------:|:---------------------------:|:----------------------:|:------------:|\n" >> $GITHUB_ENV

echo -n "| bootloader | $output_bootloader_flash_used | $output_bootloader_flash_available | $output_booloader_ram_with_percentage |\n" >> $GITHUB_ENV
echo -n "| os | $output_leka_os_flash_used | $output_leka_os_flash_available | $output_leka_os_ram_with_percentage |\n" >> $GITHUB_ENV
echo -n "| bootloader | $OUTPUT_BOOTLOADER_FLASH_USED | $OUTPUT_BOOTLOADER_FLASH_USED_DELTA | $OUTPUT_BOOTLOADER_FLASH_AVAILABLE | $OUTPUT_BOOTLOADER_RAM | $OUTPUT_BOOTLOADER_RAM_DELTA |\n" >> $GITHUB_ENV
echo -n "| os | $OUTPUT_LEKA_OS_FLASH_USED | $OUTPUT_LEKA_OS_FLASH_USED_DELTA | $OUTPUT_LEKA_OS_FLASH_AVAILABLE | $OUTPUT_LEKA_OS_RAM | $OUTPUT_LEKA_OS_RAM_DELTA |\n" >> $GITHUB_ENV

echo 'EOF_FIRMWARE_STATISTICS_OUTPUT' >> $GITHUB_ENV
1 change: 1 addition & 0 deletions .github/actions/config_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ runs:
shell: bash
run: |
make ccache_postbuild
cat ${{ env.CCACHE_LOGFILE }} || True
ccache -z
- name: Checkout head ref
Expand Down
13 changes: 8 additions & 5 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ name: "CI Setup"
description: ""

inputs:
ccache_name:
ccache_key:
description: "action/cache name for ccache"
required: true
default: "global_cache"
default: "Linux-ccache-"
ccache_restore_keys:
description: "action/cache name for ccache"
required: true
default: "Linux-ccache-"

runs:
using: "composite"
Expand Down Expand Up @@ -101,9 +105,8 @@ runs:
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR}}
key: ${{ runner.os }}-${{ inputs.ccache_name }}-ccache-${{ env.CACHE_NOW_TIME }}
restore-keys: |
${{ runner.os }}-${{ inputs.ccache_name }}-ccache-
key: ${{ inputs.ccache_key }}-(${{ env.CACHE_NOW_TIME }}) # TODO(@ladislas): separate env from setup
restore-keys: ${{ inputs.ccache_restore_keys }}

#
# Mark: - Python/pip
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/setup/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ CCACHE_DIR="/home/runner/work/ccache"
CCACHE_COMPRESS="true"
CCACHE_COMPRESSLEVEL=6
CCACHE_COMPILERCHECK="content"
CCACHE_LOGFILE="/home/runner/work/ccache/my_ccache.log"

echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=$CCACHE_COMPRESS" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=$CCACHE_COMPRESSLEVEL" >> $GITHUB_ENV
echo "CCACHE_COMPILERCHECK=$CCACHE_COMPILERCHECK" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=$CCACHE_LOGFILE" >> $GITHUB_ENV

#
# MARK: - ARM GCC Toolchain
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ci-build_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ on:
push:
branches:
- develop
- master
- main

pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
#
# Mark: - Job - build_targets
Expand All @@ -38,7 +42,11 @@ jobs:
- name: Setup CI
uses: ./.github/actions/setup
with:
ccache_name: build-target-${{ matrix.custom_target }}
ccache_key: ${{ runner.os }}-ccache-build_target-(${{ matrix.custom_target }})
ccache_restore_keys: |
${{ runner.os }}-ccache-build_target-(${{ matrix.custom_target }})-
${{ runner.os }}-ccache-build_target-
${{ runner.os }}-ccache-
#
# Mark: - Config & build
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/ci-code_analysis-clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ name: Code Analysis - Clang-Tidy
on:
push:
branches:
- master
- main
- develop

pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -41,24 +45,6 @@ jobs:
# Mark: - Analyze
#

- name: Get modified files
id: modified_files
uses: Ana06/[email protected]
with:
format: "space-delimited"
filter: "*"

- name: Run clang-tidy
run: |
echo ${{ steps.modified_files.outputs.added }} \
${{ steps.modified_files.outputs.modified }} \
${{ steps.modified_files.outputs.added_modified }} \
| xargs -n1 \
| grep -E -v "_test" \
| grep -E -v "extern" \
| grep -E -v "gtest" \
| grep -E -v "gmock" \
| grep -E -v "mocks" \
| grep -E -v "stubs" \
| grep -E "\.h$|\.cpp$" \
| xargs --no-run-if-empty ruby tools/run-clang-tidy.rb _build_cmake_tools
make clang_tidy_diff
Loading

0 comments on commit 5a49826

Please sign in to comment.