11
11
description : ' Target repository to test against'
12
12
required : false
13
13
default : ' llvm/llvm-project'
14
- clang_version :
15
- description : ' Clang version to use'
16
- required : false
17
- default : ' 20'
18
14
style :
19
15
description : ' Clang-format style'
20
16
required : false
23
19
jobs :
24
20
e2e-test :
25
21
runs-on : ubuntu-latest
22
+ strategy :
23
+ fail-fast : false
24
+ matrix :
25
+ clang_version : [13, 14, 15, 16, 17, 18, 19, 20]
26
+
27
+ name : Clang ${{ matrix.clang_version }}
26
28
steps :
27
- - name : Checkout
29
+ - name : Checkout workflow repo
28
30
uses : actions/checkout@v4
29
31
30
32
- name : Set up Python
31
33
uses : actions/setup-python@v5
32
34
with :
33
35
python-version : ' 3.13'
34
36
35
- - name : Install dependencies
37
+ - name : Install Python dependencies
36
38
run : |
37
39
python -m pip install --upgrade pip
38
40
python -m pip install pre-commit
@@ -41,27 +43,23 @@ jobs:
41
43
run : |
42
44
git clone --depth=1 https://github.com/${{ github.event.inputs.target_repo || 'llvm/llvm-project' }}.git test-repo
43
45
44
- - name : Replace pre-commit configuration
46
+ - name : Generate . pre-commit-config.yaml
45
47
run : |
46
48
cd test-repo
47
49
rm -f .pre-commit-config.yaml
48
- cat > .pre-commit-config.yaml << ' EOF'
50
+ cat > .pre-commit-config.yaml << EOF
49
51
repos:
50
- - repo: https://github.com/pre-commit/mirrors-clang-format
51
- rev: v20.1.7
52
+ - repo: https://github.com/cpp-linter/cpp-linter-hooks
53
+ rev: main
52
54
hooks:
53
55
- id: clang-format
56
+ args: [
57
+ --style=${{ github.event.inputs.style || 'file' }},
58
+ --version=${{ matrix.clang_version }}
59
+ ]
54
60
EOF
55
- # cat > .pre-commit-config.yaml << 'EOF'
56
- # repos:
57
- # - repo: https://github.com/cpp-linter/cpp-linter-hooks
58
- # rev: main
59
- # hooks:
60
- # - id: clang-format
61
- # args: [--style=${{ github.event.inputs.style || 'Google' }}, --version=${{ github.event.inputs.clang_version || '20' }}]
62
- # EOF
63
61
64
- - name : Install and run hook
62
+ - name : Install and run cpp-linter clang-format hook
65
63
run : |
66
64
cd test-repo
67
65
pre-commit install
0 commit comments