Skip to content

Commit

Permalink
Merge pull request #151 from ut-issl/develop
Browse files Browse the repository at this point in the history
Update main (v3.4.0) on 2021-12-31
  • Loading branch information
meltingrabbit authored Dec 31, 2021
2 parents a6d13cf + fe15b06 commit 80c3c26
Show file tree
Hide file tree
Showing 340 changed files with 46,114 additions and 1,504 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ひとことで

## Issue
Issue がすでに立っているならば,そのリンクを貼る
- 関連する issue

## 詳細
詳しく
Expand Down
12 changes: 12 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,15 @@
- name: "priority::medium"
description: "priority medium"
color: "fbca04"

- name: "tools"
description: ""
color: "510f70"

- name: "S2E"
description: ""
color: "eef789"

- name: "WINGS"
description: ""
color: "1503bb"
178 changes: 178 additions & 0 deletions .github/workflows/build_as_c89.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: build as C89 using SILS Mockup

on:
push:
branches:
- 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:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen-matrix.outputs.matrix }}
steps:
- name: generate matrix json
id: gen-matrix
shell: bash
run: |
compiler=(
"gcc"
"clang"
)
warning=(
"Werror"
"Wextra"
)
echo "[" > tmp
for c in "${compiler[@]}"; do
for w in "${warning[@]}"; do
if [ "$c" == "gcc" ] && [ "$w" == "Werror" ]; then
continue
fi
echo "{ \"compiler\": \"${c}\", \"warning\": \"${w}\" }" >> tmp
echo "," >> tmp
done
done
sed -i -e '$d' tmp # remove final comma
echo "]" >> tmp
sed -i -z 's/\n//g' tmp # remove newline
jq < tmp
echo "::set-output name=matrix::{\"include\": $(cat tmp) }"
build_minimum_user_as_c89:
runs-on: ubuntu-latest
needs: gen_build_matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.gen_build_matrix.outputs.matrix) }}

steps:
- uses: actions/checkout@v2

- name: install deps
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: setup
shell: bash
run: ./setup.sh

- name: generate compile option
id: compile_flags
shell: bash
run: |
WERROR="OFF"
WEXTRA="OFF"
if ${{ contains(matrix.warning, 'Werror') }}; then
WERROR="ON"
fi
if ${{ contains(matrix.warning, 'Wextra') }}; then
WEXTRA="ON"
fi
echo "::set-output name=WERROR::${WERROR}"
echo "::set-output name=WEXTRA::${WEXTRA}"
- name: cmake
working-directory: ./Examples/minimum_user_for_s2e
env:
CC: ${{ matrix.compiler }}
run: |
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DUSE_SILS_MOCKUP=ON -DADD_WERROR_FLAGS=${{ steps.compile_flags.outputs.WERROR }} -DADD_WEXTRA_FLAGS=${{ steps.compile_flags.outputs.WEXTRA }}
- name: build
id: build
continue-on-error: ${{ matrix.compiler == 'clang' }}
working-directory: ./Examples/minimum_user_for_s2e/build
run: cmake --build .

- name: run
if: steps.build.outcome == 'success'
working-directory: ./Examples/minimum_user_for_s2e/build
shell: bash
run: timeout 3 ./C2A || exit 0


- name: install reviewdog
if: matrix.compiler == 'clang'
uses: reviewdog/[email protected]

- name: install clang-tidy
if: matrix.compiler == 'clang'
run: sudo apt-get install -y clang-tidy-11

- name: clang-tidy
if: matrix.compiler == 'clang'
working-directory: ./Examples/minimum_user_for_s2e/build
run: |
run-clang-tidy-11 \
| sed 's/\/home\/runner\/work\/c2a-core\/c2a-core\///g' \
| sed 's/Examples\/minimum_user_for_s2e\/src\/src_core\///g' \
> clang_tidy.log
- name: clang-tidy result
if: matrix.compiler == 'clang'
working-directory: ./Examples/minimum_user_for_s2e/build
run: cat 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 \
-fail-on-error=true \
-filter-mode=added \
-diff="git diff FETCH_HEAD" \
-reporter=github-pr-review \
-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: |
# 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
64 changes: 64 additions & 0 deletions .github/workflows/build_as_cxx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build as C++ for S2E

on:
push:
branches:
- 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:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: setup
shell: cmd
run: ./setup.bat

- name: cmake
working-directory: ./Examples/minimum_user_for_s2e
run: |
mkdir build
cd build
cmake .. -A Win32
- name: build
working-directory: ./Examples/minimum_user_for_s2e/build
run: cmake --build .

build_s2e_mockup:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: setup
shell: cmd
run: ./setup.bat

- name: cmake
working-directory: ./Examples/minimum_user_for_s2e/src/s2e_mockup
run: |
mkdir build
cd build
cmake .. -A Win32
- name: build
working-directory: ./Examples/minimum_user_for_s2e/src/s2e_mockup/build
run: cmake --build .
24 changes: 24 additions & 0 deletions .github/workflows/check_coding_rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: check_coding_rule

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

jobs:
check_coding_rule:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- 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
working-directory: ./Examples/minimum_user_for_s2e/src
22 changes: 22 additions & 0 deletions .github/workflows/check_encoding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: check_encoding

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

jobs:
check_encoding:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- run: pip install chardet
- name: check_encoding
run: python check_encoding.py
working-directory: ./Script/CI
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: labeler
on:
push:
branches:
- main
- develop
pull_request:
paths:
- .github/workflows/labeler.yml
Expand All @@ -22,4 +22,4 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
skip-delete: false
dry-run: ${{ github.ref != 'refs/heads/main' }}
dry-run: ${{ github.ref != 'refs/heads/develop' }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ dkms.conf
.AppleDouble
.LSOverride
._*

# for c2a user sample
Examples/minimum_user_for_s2e/src/src_core
Examples/minimum_user_for_s2e/build
Examples/minimum_user_for_s2e/src/src_user/Test/authorization.json
*.pyc
25 changes: 25 additions & 0 deletions Applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.13)

project(C2A_CORE_APPS)

set(C2A_SRCS
anomaly_handler.c
divided_cmd_utility.c
gs_command_dispatcher.c
event_utility.c
memory_dump.c
nop.c
realtime_command_dispatcher.c
timeline_command_dispatcher.c
utility_command.c
utility_counter.c
telemetry_manager.c
)

if(BUILD_C2A_AS_CXX)
set_source_files_properties(${C2A_SRCS} PROPERTIES LANGUAGE CXX) # C++
endif()

add_library(${PROJECT_NAME} OBJECT ${C2A_SRCS})

include(${C2A_CORE_DIR}/common.cmake)
4 changes: 2 additions & 2 deletions Applications/anomaly_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static size_t AH_prev_act_;

AppInfo AH_create_app(void)
{
return create_app_info("ah", AH_init_, AH_exec_);
return AI_create_app_info("ah", AH_init_, AH_exec_);
}


Expand Down Expand Up @@ -225,7 +225,7 @@ static void AH_respond_to_anomaly_(size_t id)

AppInfo print_ah_status(void)
{
return create_app_info("ahs", NULL, AH_print_ah_status_);
return AI_create_app_info("ahs", NULL, AH_print_ah_status_);
}


Expand Down
Loading

0 comments on commit 80c3c26

Please sign in to comment.