Merge pull request #148 from electux/dev #68
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
name: microhildesk CC checker | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'sw/microhildesk/**' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'sw/microhildesk/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check length of line in modules | |
id: long_line_checker | |
run: | | |
echo "Checking the length of lines in modules" | |
modules_ok=0 | |
modules=($(find sw/microhildesk/ -type f -name '*.cc' -exec echo '{}' \;)) | |
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); echo "${mod} : $line_length"; [[ $line_length -gt 300 ]] && modules_ok=1; done | |
[[ $modules_ok -eq 0 ]] && echo "All modules are good" || exit 1 | |
- name: Check number of lines in modules | |
id: num_line_checker | |
run: | | |
echo "Checking the number of lines in modules" | |
modules_ok=0 | |
modules=($(find sw/microhildesk/ -type f -name '*.cc' -exec echo '{}' \;)) | |
for mod in "${modules[@]}"; do line_numbers=$(wc -l < "${mod}"); echo "${mod} : $line_numbers"; [[ $line_numbers -gt 300 ]] && modules_ok=1; done | |
[[ $modules_ok -eq 0 ]] && echo "All modules are good" && exit 0 || exit 1 |