Skip to content

Commit

Permalink
Merge pull request #243 from ut-issl/develop
Browse files Browse the repository at this point in the history
Update main (v3.5.0) on 2022-02-08
  • Loading branch information
meltingrabbit authored Feb 8, 2022
2 parents 80c3c26 + c3f1729 commit 76c7f78
Show file tree
Hide file tree
Showing 372 changed files with 32,754 additions and 24,409 deletions.
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-line-length = 100
ignore =
# black と競合するので
E203,
E501,
W503,
W504,
# https://github.com/ut-issl/c2a-core/issues/195
E402
69 changes: 31 additions & 38 deletions .github/workflows/build_as_c89.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ on:
- main
- develop
pull_request:
paths:
- '.github/workflows/build_as_c89.yml'
- 'c2a_core_main.c'
- 'c2a_core_main.h'
- 'common.cmake'
- 'Applications/**'
- 'CmdTlm/**'
- 'Drivers/**'
- 'IfWrapper/**'
- 'Library/**'
- 'System/**'
- 'Examples/minimum_user_for_s2e/CMakeLists.txt'
- 'Examples/minimum_user_for_s2e/src/**'
- 'setup.bat'
- 'setup.sh'

jobs:
gen_build_matrix:
Expand Down Expand Up @@ -70,9 +55,9 @@ jobs:
run: |
sudo apt-get install -y libc6-dev-i386 nkf
- name: convert Shift-JIS to UTF-8
if: matrix.compiler == 'clang'
run: find -- . -type f \( -name '*.h' -or -name '*.c' \) -exec nkf --overwrite -S -w80 "{}" \;
# - name: convert Shift-JIS to UTF-8
# if: matrix.compiler == 'clang'
# run: find -- . -type f \( -name '*.h' -or -name '*.c' \) -exec nkf --overwrite -S -w80 "{}" \;

- name: setup
shell: bash
Expand Down Expand Up @@ -137,12 +122,16 @@ jobs:
working-directory: ./Examples/minimum_user_for_s2e/build
run: cat clang_tidy.log

- name: remove duplicate error
if: matrix.compiler == 'clang'
run: |
python Script/CI/remove_duplicate_error.py ./Examples/minimum_user_for_s2e/build/clang_tidy.log "clang-tidy" | tee clang_tidy.log
- name: reviewdog clang-tidy (github-pr-review)
if: matrix.compiler == 'clang' && matrix.warning == 'Werror'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp ./Examples/minimum_user_for_s2e/build/clang_tidy.log .
reviewdog \
-name 'clang-tidy(Werror)' \
-level warning \
Expand All @@ -157,22 +146,26 @@ jobs:
-efm="%C%m" \
< clang_tidy.log
# - name: reviewdog clang-tidy (github-check)
# if: matrix.compiler == 'clang' && matrix.warning == 'Wextra'
# env:
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# cp ./Examples/minimum_user_for_s2e/build/clang_tidy.log .
# reviewdog \
# -name 'clang-tidy(Wextra)' \
# -level warning \
# -fail-on-error=true \
# -filter-mode=nofilter \
# -diff="git diff FETCH_HEAD" \
# -reporter=github-check \
# -efm="%-Gclang-tidy%s" \
# -efm="%-GError while processing%s" \
# -efm="%W%f:%l:%c: warning: %m" \
# -efm="%E%f:%l:%c: error: %m" \
# -efm="%C%m" \
# < clang_tidy.log
- name: reviewdog clang-tidy (github-check)
if: matrix.compiler == 'clang' && matrix.warning == 'Wextra'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
reviewdog \
-name 'clang-tidy(Wextra)' \
-level warning \
-fail-on-error=true \
-filter-mode=nofilter \
-diff="git diff FETCH_HEAD" \
-reporter=github-check \
-efm="%-Gclang-tidy%s" \
-efm="%-GError while processing%s" \
-efm="%W%f:%l:%c: warning: %m" \
-efm="%E%f:%l:%c: error: %m" \
-efm="%C%m" \
< clang_tidy.log
- name: build failed
if: steps.build.outcome == 'failure'
shell: bash
run: exit 1
15 changes: 0 additions & 15 deletions .github/workflows/build_as_cxx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ on:
- main
- develop
pull_request:
paths:
- '.github/workflows/build_as_cxx.yml'
- 'c2a_core_main.c'
- 'c2a_core_main.h'
- 'common.cmake'
- 'Applications/**'
- 'CmdTlm/**'
- 'Drivers/**'
- 'IfWrapper/**'
- 'Library/**'
- 'System/**'
- 'Examples/minimum_user_for_s2e/CMakeLists.txt'
- 'Examples/minimum_user_for_s2e/src/**'
- 'setup.bat'
- 'setup.sh'

jobs:
build_minimum_user_as_cxx:
Expand Down
43 changes: 41 additions & 2 deletions .github/workflows/check_coding_rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,45 @@ jobs:
- name: setup
shell: bash
run: ./setup.sh
- name: check_coding_rule
run: python ./src_core/Script/CI/check_coding_rule.py ./src_core/Script/CI/check_coding_rule.json
- name: check coding rule
id: check
shell: bash -e {0}
continue-on-error: true
working-directory: ./Examples/minimum_user_for_s2e/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 "::set-output name=status::${status}"
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\/minimum_user_for_s2e\/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 }}" ))
2 changes: 1 addition & 1 deletion .github/workflows/check_encoding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
architecture: 'x64'
- run: pip install chardet
- name: check_encoding
run: python check_encoding.py
run: python ./check_encoding.py ./check_encoding.json
working-directory: ./Script/CI
26 changes: 26 additions & 0 deletions .github/workflows/python_check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: reviewdog / python format check

on:
push:
branches:
- main
- develop
pull_request:

jobs:
black_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# - name: check python format with black
# uses: psf/black@stable

- uses: reviewdog/action-black@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# reporter: github-pr-review # TODO: いい感じになったら直す
reporter: github-pr-check
filter_mode: nofilter
fail_on_error: true
level: warning
28 changes: 28 additions & 0 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: reviewdog / lint python

on:
push:
branches:
- main
- develop
pull_request:

jobs:
flake8_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up python environment
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: flake8 Lint
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: nofilter
fail_on_error: true
level: warning
Loading

0 comments on commit 76c7f78

Please sign in to comment.