Skip to content

Update simavr submodule #859

Update simavr submodule

Update simavr submodule #859

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Code Lint
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
cppcheck:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
if: ${{ github.event.pull_request }}
with:
repository: vintagepc/MK404.git
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
if: ${{ !github.event.pull_request }}
with:
repository: vintagepc/MK404.git
ref: ${{ github.event.ref }}
submodules: true
- name: Cache packages
uses: actions/cache@v3.0.11
id: cache-pkgs
with:
path: "packages"
key: "pkgs-linting_1_0"
- name: Setup cache dir
if: ${{ ! steps.cache-valgrind.outputs.cache-hit }}
run: mkdir -p packages/partial
- name: Install packages
run: |
sudo apt-get update
sudo apt-get purge clang-*
sudo apt-get -o Dir::Cache::Archives=`pwd`/packages install clang-6.0 clang-tidy-6.0
sudo apt-get -o Dir::Cache::Archives=`pwd`/packages install libelf-dev gcc-avr libglew-dev freeglut3-dev libsdl2-dev iwyu cppcheck
- name: Cache permissions
run: sudo chmod -R 744 packages
- name: Prepare CMake build
run: mkdir ${{ runner.workspace }}/MK404/build && cd ${{ runner.workspace }}/MK404/build && cmake -DCMAKE_BUILD_TYPE=DEBUG -DCPPCHECK_ONLY=1 ..
- name: Run CPPCheck
run: cd ${{ runner.workspace }}/MK404/build && make -j2 CPPCheck
- name: Run Clang-tidy
run: |
cd ${{ runner.workspace }}/MK404/build
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCPPCHECK_ONLY=0 -DENABLE_TIDY=1 ..
make -j2 simavr
make -j2 |& tee tidy.txt
- name: Upload clang-tidy log
uses: actions/upload-artifact@v3.1.1
with:
name: warnings
path: ${{ runner.workspace }}/MK404/build/tidy.txt
- name : Final status
id: tidy_status
run: |
cd ${{ runner.workspace }}/MK404
cat build/tidy.txt | python3 3rdParty/clang-tidy-to-github.py `pwd`
grep -v "jobserver unavailable" ${{ runner.workspace }}/MK404/build/tidy.txt > ${{ runner.workspace }}/MK404/build/tidy2.txt
! grep -q "warning:" ${{ runner.workspace }}/MK404/build/tidy2.txt