Skip to content

Commit 663ad69

Browse files
committed
Add e2e.yml test workflow
1 parent c1d5f09 commit 663ad69

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/e2e.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: E2E Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
inputs:
8+
target_repo:
9+
description: 'Target repository to test against'
10+
required: false
11+
default: 'llvm/llvm-project'
12+
13+
jobs:
14+
e2e-test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
clang_version: [16, 17, 18, 19, 20, 21]
20+
21+
name: Test clang ${{ matrix.clang_version }}
22+
steps:
23+
- name: Checkout workflow repo
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.13'
30+
31+
- name: Install Python dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install pre-commit
35+
36+
- name: Clone target repository
37+
run: |
38+
git clone --depth=1 https://github.com/${{ github.event.inputs.target_repo || 'llvm/llvm-project' }}.git test-repo
39+
40+
- name: Create .pre-commit-config.yaml
41+
run: |
42+
cd test-repo
43+
rm -f .pre-commit-config.yaml
44+
cat > .pre-commit-config.yaml << EOF
45+
repos:
46+
- repo: https://github.com/cpp-linter/cpp-linter-hooks
47+
rev: main
48+
hooks:
49+
- id: clang-format
50+
args: [
51+
--style=LLVM,
52+
--version=${{ matrix.clang_version }}
53+
]
54+
EOF
55+
56+
- name: Install and run cpp-linter-hooks
57+
run: |
58+
cd test-repo
59+
pre-commit install
60+
pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: check-toml
1111
- id: requirements-txt-fixer
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.13.1
13+
rev: v0.14.2
1414
hooks:
1515
# Run the linter.
1616
- id: ruff-check

0 commit comments

Comments
 (0)