File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Large Codebase Functional Test
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+ workflow_dispatch :
9+ inputs :
10+ target_repo :
11+ description : ' Target repository to test against'
12+ required : false
13+ default : ' python/cpython'
14+ clang_version :
15+ description : ' Clang version to use'
16+ required : false
17+ default : ' 20'
18+ style :
19+ description : ' Clang-format style'
20+ required : false
21+ default : ' Google'
22+
23+ jobs :
24+ test :
25+ name : Test cpp-linter-hooks
26+ runs-on : ubuntu-latest
27+
28+ steps :
29+ - name : Checkout cpp-linter-hooks
30+ uses : actions/checkout@v4
31+
32+ - name : Set up Python 3.11
33+ uses : actions/setup-python@v4
34+ with :
35+ python-version : ' 3.11'
36+
37+ - name : Install dependencies
38+ run : |
39+ python -m pip install --upgrade pip
40+ python -m pip install pre-commit
41+
42+ - name : Clone target repository
43+ run : |
44+ git clone --depth=1 https://github.com/${{ github.event.inputs.target_repo || 'python/cpython' }}.git test-repo
45+
46+ - name : Replace pre-commit configuration
47+ run : |
48+ cd test-repo
49+ rm -f .pre-commit-config.yaml
50+ cat > .pre-commit-config.yaml << 'EOF'
51+ repos:
52+ - repo: https://github.com/cpp-linter/cpp-linter-hooks
53+ rev: v0.8.1
54+ hooks:
55+ - id: clang-format
56+ args: [--style=${{ github.event.inputs.style || 'Google' }}, --version=${{ github.event.inputs.clang_version || '20' }}]
57+ files: ^(.*\.(c|cc|cpp|cxx|h|hpp|hxx))$
58+ EOF
59+
60+ - name : Install pre-commit hooks
61+ run : |
62+ cd test-repo
63+ pre-commit install
64+ pre-commit run --all-files
You can’t perform that action at this time.
0 commit comments