Skip to content

Commit 6a730aa

Browse files
authored
Merge pull request #10 from topoteretes/ci/setup-ci-testing
feat: add GitHub workflows for Ruff formatting and example script testing
2 parents a147cb1 + 16186e0 commit 6a730aa

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/workflows/ruff-check.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Ruff Format Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
ruff-format:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v6
21+
with:
22+
python-version-file: ".python-version"
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v6
26+
with:
27+
enable-cache: true
28+
29+
- name: Install dependenices
30+
run: uv sync --locked --all-extras --dev
31+
32+
- name: Check formatting with ruff
33+
run: uv run ruff format --check .
34+
35+
- name: Run ruff linter
36+
run: uv run ruff check .
37+

.github/workflows/test-example.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test Example Script
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
pr_number:
10+
description: 'PR number to test (optional for manual runs)'
11+
required: false
12+
type: number
13+
14+
jobs:
15+
test-example:
16+
runs-on: ubuntu-latest
17+
if: |
18+
github.event_name == 'workflow_dispatch' ||
19+
github.event.pull_request.author_association == 'MEMBER' ||
20+
github.event.pull_request.author_association == 'OWNER' ||
21+
github.event.pull_request.author_association == 'COLLABORATOR'
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v5
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version-file: ".python-version"
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v6
36+
with:
37+
enable-cache: true
38+
39+
- name: Install dependencies
40+
run: |
41+
uv sync --locked --all-extras
42+
43+
- name: Run example script
44+
env:
45+
LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }}
46+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
47+
run: |
48+
uv run python examples/example.py
49+

0 commit comments

Comments
 (0)