-
-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (59 loc) · 1.85 KB
/
e2e.yml
File metadata and controls
67 lines (59 loc) · 1.85 KB
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
name: E2E Test
on:
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
target_repo:
description: 'Target repository to test against'
required: false
default: 'llvm/llvm-project'
style:
description: 'Clang-format style'
required: false
default: 'file'
jobs:
e2e-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clang_version: [16, 17, 18, 19, 20]
name: Test clang ${{ matrix.clang_version }}
steps:
- name: Checkout workflow repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
- name: Clone target repository
run: |
git clone --depth=1 https://github.com/${{ github.event.inputs.target_repo || 'llvm/llvm-project' }}.git test-repo
- name: Generate .pre-commit-config.yaml
run: |
cd test-repo
rm -f .pre-commit-config.yaml
cat > .pre-commit-config.yaml << EOF
repos:
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: main
hooks:
- id: clang-format
args: [
--style=${{ github.event.inputs.style || 'file' }},
--version=${{ matrix.clang_version }}
]
EOF
- name: Install and run cpp-linter-hooks
run: |
cd test-repo
pre-commit install
# Run clang-format in smaller chunks
for dir in $(find . -type d -name '*'); do
pre-commit run --files $(find "$dir" -name '*.cpp' -o -name '*.h' | head -n 1000)
done