CI Checks #2713
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: CI Checks | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: | |
- main | |
- development | |
- cbmc-proof | |
workflow_dispatch: | |
jobs: | |
compiler-warnings: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone This Repo | |
uses: actions/checkout@v3 | |
- name: Check warnings | |
run: | | |
git submodule update --init --recursive --checkout --depth 1 | |
cmake -S test -B build -DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DLOG_LEVEL=LOG_LEVEL_DEBUG' | |
cmake --build build | |
complexity: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup | |
run: sudo apt-get install complexity | |
- name: Complexity | |
uses: Skptak/CI-CD-Github-Actions/complexity@main | |
with: | |
path: ./ | |
horrid_threshold: 14 | |
unittest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone This Repo | |
uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
git submodule update --init --recursive --checkout --depth 1 | |
cmake -S test -B build -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build | |
- name: Test | |
run: | | |
cd build/ | |
ctest -E system --output-on-failure | |
cd .. | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone This Repo | |
uses: actions/checkout@v3 | |
- name: Generate Build Files | |
run: | | |
git submodule update --init --recursive --checkout --depth 1 | |
sudo apt-get install -y lcov | |
cmake -S test -B build \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG' | |
- name: Run Coverage | |
run: | | |
cmake --build build/ --target coverage | |
- name: Check Coverage | |
uses: Skptak/CI-CD-Github-Actions/coverage-cop@main | |
with: | |
path: ./build/coverage.info | |
line-coverage-min: 100 | |
branch-coverage-min: 100 | |
doxygen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run doxygen build | |
uses: Skptak/CI-CD-Github-Actions/doxygen@main | |
with: | |
path: ./ | |
spell-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Parent Repo | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
repository: aws/aws-iot-device-sdk-embedded-C | |
- name: Clone This Repo | |
uses: actions/checkout@v3 | |
with: | |
path: tmp | |
- name: Install spell | |
run: | | |
sudo apt-get install spell | |
sudo apt-get install util-linux | |
- name: Check spelling | |
run: | | |
PATH=$PATH:$PWD/tools/spell | |
find-unknown-comment-words --directory tmp/ --lexicon tmp/tools/lexicon.txt | |
if [ $? -ne "0" ]; then | |
exit 1 | |
fi | |
formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check formatting | |
uses: Skptak/CI-CD-Github-Actions/formatting@main | |
with: | |
path: ./ | |
exclude-dirs: docs,.github | |
git-secrets: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Checkout awslabs/git-secrets | |
uses: actions/checkout@v3 | |
with: | |
repository: awslabs/git-secrets | |
ref: master | |
path: git-secrets | |
- name: Install git-secrets | |
run: cd git-secrets && sudo make install && cd .. | |
- name: Run git-secrets | |
run: | | |
git-secrets --register-aws | |
git-secrets --scan | |
memory_statistics: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Clone submodules | |
run: git submodule update --init --recursive --checkout --depth 1 | |
- name: Install Python3 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11.0" | |
- name: Measure sizes | |
uses: Skptak/CI-CD-Github-Actions/memory_statistics@main | |
with: | |
config: .github/memory_statistics_config.json | |
check_against: docs/doxygen/include/size_table.md | |
link-verifier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check Links | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: Skptak/CI-CD-Github-Actions/link-verifier@main | |
with: | |
path: ./ | |
proof_ci: | |
if: ${{ github.event.pull_request }} | |
runs-on: cbmc_ubuntu-latest_16-core | |
steps: | |
- name: Set up CBMC runner | |
uses: Skptak/CI-CD-Github-Actions/set_up_cbmc_runner@main | |
- run: | | |
git submodule update --init --checkout --recursive --depth 1 | |
- name: Run CBMC | |
uses: Skptak/CI-CD-Github-Actions/run_cbmc@main | |
with: | |
proofs_dir: test/cbmc/proofs |