-
Notifications
You must be signed in to change notification settings - Fork 12
54 lines (51 loc) · 1.5 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Lint and format 💅
on:
workflow_dispatch:
push:
pull_request:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
jobs:
lint:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add missing deps
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y bear sudo
- name: Generate compilation database
run: bear -- make -j BOLOS_SDK="$NANOSP_SDK"
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Lint and format 💅
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file-annotations: true
files-changed-only: false
ignore: "app/build|cmake|deps|fuzz|tests"
step-summary: true
style: file # uses .clang-format
thread-comments: true
tidy-checks: "" # use only .clang-tidy checks
- name: Fail if errors
if: steps.linter.outputs.checks-failed > 0
run: |
echo "Linter or formatter failed!"
exit 1