2021-07-24 16:53:02 +03:00
|
|
|
name: 'Lint C/C++ with clang-format'
|
|
|
|
|
2021-08-06 02:33:15 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- '**.h'
|
|
|
|
- '**.c'
|
|
|
|
- '**.hpp'
|
|
|
|
- '**.cpp'
|
|
|
|
pull_request:
|
2021-07-24 16:53:02 +03:00
|
|
|
|
|
|
|
env:
|
|
|
|
TARGETS: f6
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint_c_cpp:
|
|
|
|
runs-on: [self-hosted]
|
|
|
|
steps:
|
|
|
|
- name: 'Cleanup workspace'
|
|
|
|
uses: AutoModality/action-clean@v1
|
|
|
|
|
2021-07-25 14:46:34 +03:00
|
|
|
- name: 'Decontaminate previous build leftovers'
|
|
|
|
run: |
|
|
|
|
if [ -d .git ]
|
|
|
|
then
|
|
|
|
git submodule status \
|
|
|
|
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
|
|
fi
|
|
|
|
|
2021-07-24 16:53:02 +03:00
|
|
|
- name: 'Checkout code'
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-07-25 14:46:34 +03:00
|
|
|
submodules: true
|
2021-07-24 16:53:02 +03:00
|
|
|
|
|
|
|
- name: 'Docker cache'
|
|
|
|
uses: satackey/action-docker-layer-caching@v0.0.11
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
key: docker-cache-${{ hashFiles('docker/**') }}-{hash}
|
|
|
|
restore-keys: docker-cache-${{ hashFiles('docker/**') }}-
|
|
|
|
|
|
|
|
- name: 'Build docker image'
|
|
|
|
uses: ./.github/actions/docker
|
|
|
|
|
|
|
|
- name: 'Check syntax'
|
|
|
|
uses: ./.github/actions/docker
|
|
|
|
continue-on-error: false
|
|
|
|
with:
|
|
|
|
run: /syntax_check.sh
|