-
Notifications
You must be signed in to change notification settings - Fork 0
ci: GitHub Actions CI/CD (lint, types, tests, multimodal + token/usage, secret scan) #17
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d9ad590
ci: GitHub Actions CI/CD (lint, types, tests, multimodal + token/usag…
Abhinavexist cb6bd2d
ci: drop py3.9 (langchain needs 3.10+), run mypy once on 3.12 leg (re…
Abhinavexist cfe48f0
build: bump requires-python >=3.8 -> >=3.9 (openai 2.x dropped 3.8) b…
Abhinavexist 0b53faa
ci: add core-only py3.9 leg (langchain skipped) so declared >=3.9 sup…
Abhinavexist 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,61 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: test (py${{ matrix.python-version }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| enable-cache: true | ||
| - name: Install (all extras) | ||
| run: uv sync --all-extras | ||
| - name: Lint (ruff) | ||
| run: uv run ruff check src tests scripts | ||
| - name: Type check (mypy --strict) | ||
| if: matrix.python-version == '3.12' | ||
| run: uv run mypy | ||
| - name: Unit tests | ||
| run: uv run pytest -q | ||
|
|
||
| test-core-py39: | ||
| name: test (py3.9, core only) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: "3.9" | ||
| enable-cache: true | ||
| # langchain-openai is gated python_version>='3.10', so it's skipped on 3.9 and its tests no-op. | ||
| - name: Install (dev extras; langchain skipped on 3.9) | ||
| run: uv sync --extra dev | ||
| - name: Lint (ruff) | ||
| run: uv run ruff check src tests scripts | ||
| - name: Unit tests | ||
| run: uv run pytest -q | ||
|
|
||
| secret-scan: | ||
| name: secret scan (gitleaks) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Scan working tree for leaked tokens/secrets | ||
| run: | | ||
| curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz" | tar -xz gitleaks | ||
| ./gitleaks dir . --redact --no-banner | ||
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,59 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Build sdist + wheel | ||
| run: uv build | ||
| - name: Verify metadata | ||
| run: uvx twine check dist/* | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| testpypi: | ||
| needs: build | ||
| if: github.event.release.prerelease == true | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: testpypi | ||
| url: https://test.pypi.org/p/interfaze | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ | ||
|
|
||
| pypi: | ||
| needs: build | ||
| if: github.event.release.prerelease == false | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/interfaze | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 |
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,29 @@ | ||
| name: Live QA | ||
|
|
||
| # Live e2e against the real API; gated on the INTERFAZE_API_KEY secret (never on PRs). | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 6 * * 1" # weekly, Monday 06:00 UTC | ||
|
|
||
| concurrency: | ||
| group: live-qa | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| live-qa: | ||
| name: live QA (multimodal + token usage + tasks) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: "3.12" | ||
| enable-cache: true | ||
| - name: Install | ||
| run: uv sync | ||
| - name: Run live QA | ||
| env: | ||
| INTERFAZE_API_KEY: ${{ secrets.INTERFAZE_API_KEY }} | ||
| run: uv run python scripts/qa_live.py |
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
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
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
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
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.