-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add e2e.yml #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
70a5959
3b4fee3
e0f4b6d
fb063a7
a855e93
adcb858
b55bff2
1a8ab5c
6827c72
a8f64d9
f966317
aaf2d2e
1f44868
46af185
a599c9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,63 @@ | ||||||||||||||||||||||
name: End-to-End Test | ||||||||||||||||||||||
|
||||||||||||||||||||||
on: | ||||||||||||||||||||||
push: | ||||||||||||||||||||||
branches: [ main ] | ||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||
branches: [ main ] | ||||||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||||||
inputs: | ||||||||||||||||||||||
target_repo: | ||||||||||||||||||||||
description: 'Target repository to test against' | ||||||||||||||||||||||
required: false | ||||||||||||||||||||||
default: 'python/cpython' | ||||||||||||||||||||||
clang_version: | ||||||||||||||||||||||
description: 'Clang version to use' | ||||||||||||||||||||||
required: false | ||||||||||||||||||||||
default: '20' | ||||||||||||||||||||||
style: | ||||||||||||||||||||||
description: 'Clang-format style' | ||||||||||||||||||||||
required: false | ||||||||||||||||||||||
default: 'Google' | ||||||||||||||||||||||
|
||||||||||||||||||||||
jobs: | ||||||||||||||||||||||
e2e-test: | ||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||
steps: | ||||||||||||||||||||||
- name: Checkout | ||||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||||
|
||||||||||||||||||||||
- name: Set up Python 3.13 | ||||||||||||||||||||||
uses: actions/setup-python@v4 | ||||||||||||||||||||||
with: | ||||||||||||||||||||||
python-version: '3.13' | ||||||||||||||||||||||
|
||||||||||||||||||||||
- name: Install dependencies | ||||||||||||||||||||||
run: | | ||||||||||||||||||||||
python -m pip install --upgrade pip | ||||||||||||||||||||||
python -m pip install pre-commit | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+35
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Install the required - name: Install dependencies
run: |
+ sudo apt-get update
+ sudo apt-get install -y clang-format-${{ github.event.inputs.clang_version || '20' }}
python -m pip install --upgrade pip
python -m pip install pre-commit 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||
- name: Clone target repository | ||||||||||||||||||||||
run: | | ||||||||||||||||||||||
git clone --depth=1 https://github.com/${{ github.event.inputs.target_repo || 'python/cpython' }}.git test-repo | ||||||||||||||||||||||
|
||||||||||||||||||||||
- name: Replace pre-commit configuration | ||||||||||||||||||||||
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: v0.8.3 | ||||||||||||||||||||||
hooks: | ||||||||||||||||||||||
- id: clang-format | ||||||||||||||||||||||
args: [--style=${{ github.event.inputs.style || 'Google' }}, --version=${{ github.event.inputs.clang_version || '20' }}] | ||||||||||||||||||||||
files: ^(.*\.(c|cc|cpp|cxx|h|hpp|hxx))$ | ||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||
exclude: Modules/_ctypes/cfield.c | ||||||||||||||||||||||
EOF | ||||||||||||||||||||||
|
||||||||||||||||||||||
- name: Install and run hook | ||||||||||||||||||||||
run: | | ||||||||||||||||||||||
cd test-repo | ||||||||||||||||||||||
pre-commit install | ||||||||||||||||||||||
pre-commit run --all-files |
Uh oh!
There was an error while loading. Please reload this page.