Skip to content

Commit

Permalink
Establish test pipeline for static code analysis
Browse files Browse the repository at this point in the history
Uses docker that is pulled from container registry. Due to issue
actions/runner#434 in github actions
there is no clean sleeve at the start of the run, actions do not
use temporary workspaces but employ existing file systems on the
runner's system instead. This can lead to undefined behavior if
no cleanup is executed before checkout. Also mind that there
will be issues with the file system's permission if the docker
container's user does not match the UID of the action runner's UID.
  • Loading branch information
Holger Jorra authored and hjokunbus committed May 9, 2022
1 parent cb2e828 commit c548d20
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Clang-Tidy docker runner

on: [push]

jobs:
test:
name: Run static code analysis
runs-on: [self-hosted, tests-only]
container:
image: ghcr.io/revolutionpi/clang-tidy-analysis:0.3
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_READ }}
steps:

# workaround github runner environment pollution
- name: Clean the workspace
run: rm -rf $GITHUB_WORKSPACE/*

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Test with clang-tidy
run: clang-tidy src/*.c src/*.h -- -IpiControl -std=c99

0 comments on commit c548d20

Please sign in to comment.