-
Notifications
You must be signed in to change notification settings - Fork 7
/
action.yaml
53 lines (46 loc) · 2 KB
/
action.yaml
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
name: "cmake-format lint action"
author: "Puneet Matharu"
description: "A GitHub Action to format CMake-specific files using cmake-format (v0.6.13)"
branding:
icon: "code"
color: "blue"
inputs:
args:
description: |
Arguments to supply to cmake-format.
Options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-l {error,warning,info,debug}, --log-level {error,warning,info,debug}
--dump-config [{yaml,json,python}]
If specified, print the default configuration to stdout and exit
--dump {lex,parse,parsedb,layout,markup}
--no-help When used with --dump-config, will omit helptext comments in the output
--no-default When used with --dump-config, will omit any unmodified configuration value.
-i, --in-place
--check Exit with status code 0 if formatting would not change file contents, or status code 1 if it would
-o OUTFILE_PATH, --outfile-path OUTFILE_PATH
Where to write the formatted file. Default is stdout.
-c CONFIG_FILES [CONFIG_FILES ...], --config-files CONFIG_FILES [CONFIG_FILES ...]
path to configuration file(s)
required: true
default: "--help"
file-regex:
description: |
Regex to select which files to apply cmake-format on.
Defaults to '(.*\.cmake$|CMakeLists.txt$)'
required: false
default: '(.*\.cmake$|CMakeLists.txt$)'
runs:
using: "composite"
steps:
- name: Set up python3
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install cmake-format
shell: bash
run: python3 -m pip install --no-cache-dir "Cython<3" "cmakelang[YAML]==0.6.13"
- name: Format CMake files
shell: bash
run: python3 ${{ github.action_path }}/entrypoint.py --cmake-format-args '${{ inputs.args }}' --file-regex '${{ inputs.file-regex }}'