-
Notifications
You must be signed in to change notification settings - Fork 311
114 lines (101 loc) · 3.01 KB
/
check-code-formatting.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Check code formatting
on:
pull_request:
paths:
- ".github/workflows/check-code-formatting.yml"
- "avr/bootloaders/optiboot/source/**"
- "avr/bootloaders/micronucleus/firmware/**"
# - "avr/cores/**"
- "avr/libraries/**"
# - "avr/variants/**"
push:
paths:
- ".github/workflows/check-code-formatting.yml"
- "avr/bootloaders/optiboot/source/**"
# - "avr/bootloaders/micronucleus/firmware/**" Not checked in yet.
# - "avr/cores/**" # Artistic style deals unacceptably poorly with nested ifdefs.
- "avr/libraries/**"
# - "avr/variants/**" #prohibited formatting in variant files is done intentionally to improve readability and clarity. Don't run the code style checker there.
# workflow_dispatch event allows the workflow to be triggered manually
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
# repository_dispatch event allows the workflow to be triggered via the GitHub API
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
env:
OPTIONS_FILE_PATH: avr/extras/ci/arduino-code-style.conf
NAME_PATTERNS: |
- '*.ino'
- '*.h'
- '*.hpp'
- '*.hh'
- '*.hxx'
- '*.h++'
- '*.cpp'
- '*.cc'
- '*.cxx'
- '*.c++'
- '*.cp'
- '*.c'
- '*.ipp'
- '*.ii'
- '*.ixx'
- '*.inl'
- '*.tpp'
- '*.txx'
- '*.tpl'
jobs:
# bootloaders:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Check code formatting
# uses: per1234/artistic-style-action@main
# with:
# options-file-path: ${{ env.OPTIONS_FILE_PATH }}
# name-patterns: |
# ${{ env.NAME_PATTERNS }}
# target-paths: |
# - avr/bootloaders
# cores:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Check code formatting
# uses: per1234/artistic-style-action@main
# with:
# options-file-path: ${{ env.OPTIONS_FILE_PATH }}
# name-patterns: |
# ${{ env.NAME_PATTERNS }}
# target-paths: |
# - avr/cores
libraries:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check code formatting
uses: per1234/artistic-style-action@main
with:
options-file-path: ${{ env.OPTIONS_FILE_PATH }}
name-patterns: |
${{ env.NAME_PATTERNS }}
target-paths: |
- avr/libraries
variants:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check code formatting
uses: per1234/artistic-style-action@main
with:
options-file-path: ${{ env.OPTIONS_FILE_PATH }}
name-patterns: |
${{ env.NAME_PATTERNS }}
target-paths: |
- avr/variants