-
Notifications
You must be signed in to change notification settings - Fork 1
ci: add pipeline with upstream libinjection integration #9
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d7f1e64
Initial plan
Copilot d5617a0
Add GitHub Actions CI pipeline for testing with upstream libinjection
Copilot f1514b2
Merge branch 'main' into copilot/add-pipeline-tests
fzipi 09faf79
Apply suggestion from @fzipi
fzipi a697e57
Apply suggestions from code review
fzipi 2b9c83d
Fix pipeline warnings: upgrade actions to Node.js 24, fix undefined s…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
|
fzipi marked this conversation as resolved.
Outdated
|
||
| schedule: | ||
| # Run weekly on Mondays at midnight UTC to catch upstream changes | ||
| - cron: '0 0 * * 1' | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y swig gcc python3-dev | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| pip install --upgrade pip setuptools pytest | ||
|
|
||
| - name: Clone upstream libinjection | ||
| run: | | ||
| git clone --depth=1 https://github.com/libinjection/libinjection.git upstream | ||
|
|
||
| - name: Copy upstream source files | ||
| run: | | ||
| cp -f upstream/src/libinjection*.h upstream/src/libinjection*.c libinjection/ | ||
|
|
||
| - name: Create tests symlink for test_driver.py | ||
| # test_driver.py resolves test files relative to ../tests from the repo root | ||
| run: | | ||
| ln -s "$(realpath upstream/tests)" "$(realpath ..)/tests" | ||
|
|
||
| - name: Generate words.py from upstream data | ||
| run: | | ||
| python json2python.py < upstream/src/sqlparse_data.json > words.py | ||
|
|
||
| - name: Generate SWIG wrapper | ||
| run: | | ||
| swig -py3 -python -builtin -Wall -Wextra libinjection/libinjection.i | ||
|
|
||
| - name: Build C extension in-place | ||
| run: | | ||
| python setup.py build_ext --inplace | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| pytest test_driver.py -v | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.