Skip to content

Update arkedge/workflows-c2a action to v3 - autoclosed #43

Update arkedge/workflows-c2a action to v3 - autoclosed

Update arkedge/workflows-c2a action to v3 - autoclosed #43

name: check_coding_rule
on:
push:
branches:
- main
- develop
pull_request:
jobs:
check_coding_rule:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- mobc
- subobc
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: .github/workflows/.python-version
architecture: 'x64'
- name: setup
shell: bash
run: ./setup.sh
- name: check coding rule
id: check
shell: bash -e {0}
continue-on-error: true
working-directory: ./Examples/${{ matrix.example }}/src
run: |
python ./src_core/Script/CI/check_coding_rule.py ./src_core/Script/CI/check_coding_rule.json | tee /tmp/coding-rule.log
status="${PIPESTATUS[0]}"
echo "status: ${status}"
echo "status=${status}" >> "$GITHUB_OUTPUT"
exit "${status}"
- name: install reviewdog
uses: reviewdog/[email protected]
- name: fix error log source file path
run: |
sed 's/.\/src_core\///g' < /tmp/coding-rule.log \
| > ./coding-rule.log \
sed 's/.\/src_user/Examples\/${{ matrix.example }}\/src\/src_user/g'
cat ./coding-rule.log
- name: reviewdog(github-pr-review)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
reviewdog \
-name 'check_coding_rule' \
-level error \
-fail-on-error=true \
-filter-mode=added \
-diff="git diff FETCH_HEAD" \
-reporter=github-pr-review \
-efm="%-GThe above files are invalid coding rule." \
-efm="%E%f: %l: %m" \
-efm="%Z%s" \
< coding-rule.log
- name: exit
shell: bash
run: |
exit $(( "${{ steps.check.outputs.status }}" ))