|
5 | 5 | branches: [main, master] |
6 | 6 | pull_request: |
7 | 7 | branches: [main, master] |
8 | | - workflow_dispatch: # Allow manual runs |
| 8 | + workflow_dispatch: |
9 | 9 |
|
10 | | -# Cancel in-progress runs on the same branch/PR |
11 | 10 | concurrency: |
12 | 11 | group: ${{ github.workflow }}-${{ github.ref }} |
13 | 12 | cancel-in-progress: true |
14 | 13 |
|
15 | 14 | jobs: |
16 | | - lint: |
17 | | - name: Lint |
| 15 | + ci: |
| 16 | + name: CI |
18 | 17 | runs-on: ubuntu-latest |
19 | 18 | steps: |
20 | | - - name: Checkout code |
21 | | - uses: actions/checkout@v4 |
| 19 | + - uses: actions/checkout@v4 |
22 | 20 |
|
23 | | - - name: Set up Python |
24 | | - uses: actions/setup-python@v5 |
| 21 | + - uses: actions/setup-python@v5 |
25 | 22 | with: |
26 | 23 | python-version: '3.11' |
27 | 24 |
|
28 | | - - name: Install uv |
29 | | - uses: astral-sh/setup-uv@v4 |
| 25 | + - uses: astral-sh/setup-uv@v4 |
30 | 26 | with: |
31 | 27 | version: "latest" |
32 | 28 |
|
33 | | - - name: Cache uv dependencies |
34 | | - uses: actions/cache@v4 |
| 29 | + - uses: actions/cache@v4 |
35 | 30 | with: |
36 | 31 | path: ~/.cache/uv |
37 | 32 | key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }} |
38 | | - restore-keys: | |
39 | | - ${{ runner.os }}-uv- |
| 33 | + restore-keys: ${{ runner.os }}-uv- |
40 | 34 |
|
41 | 35 | - name: Install dependencies |
42 | 36 | run: uv sync --dev |
43 | 37 |
|
44 | | - - name: Run Ruff linter |
45 | | - run: uv run ruff check src/ tests/ |
46 | | - |
47 | | - - name: Check code formatting |
48 | | - run: uv run ruff format --check src/ tests/ |
49 | | - |
50 | | - test: |
51 | | - name: Test (Python ${{ matrix.python-version }}) |
52 | | - runs-on: ubuntu-latest |
53 | | - strategy: |
54 | | - fail-fast: false |
55 | | - matrix: |
56 | | - python-version: ['3.11', '3.12'] |
57 | | - |
58 | | - steps: |
59 | | - - name: Checkout code |
60 | | - uses: actions/checkout@v4 |
61 | | - |
62 | | - - name: Set up Python ${{ matrix.python-version }} |
63 | | - uses: actions/setup-python@v5 |
64 | | - with: |
65 | | - python-version: ${{ matrix.python-version }} |
66 | | - |
67 | | - - name: Install uv |
68 | | - uses: astral-sh/setup-uv@v4 |
69 | | - with: |
70 | | - version: "latest" |
71 | | - |
72 | | - - name: Cache uv dependencies |
73 | | - uses: actions/cache@v4 |
74 | | - with: |
75 | | - path: ~/.cache/uv |
76 | | - key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }} |
77 | | - restore-keys: | |
78 | | - ${{ runner.os }}-uv- |
79 | | -
|
80 | | - - name: Install dependencies |
81 | | - run: uv sync --dev |
82 | | - |
83 | | - - name: Run tests |
84 | | - run: uv run pytest tests/ -v |
85 | | - |
86 | | - - name: Generate test summary |
87 | | - if: always() |
| 38 | + - name: Lint & format check |
88 | 39 | run: | |
89 | | - echo "### Test Results :test_tube:" >> $GITHUB_STEP_SUMMARY |
90 | | - echo "Python version: ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY |
91 | | - echo "Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY |
92 | | -
|
93 | | - docker: |
94 | | - name: Docker Build |
95 | | - runs-on: ubuntu-latest |
96 | | - steps: |
97 | | - - name: Checkout code |
98 | | - uses: actions/checkout@v4 |
99 | | - |
100 | | - - name: Set up Docker Buildx |
101 | | - uses: docker/setup-buildx-action@v3 |
102 | | - |
103 | | - - name: Build Docker image |
104 | | - uses: docker/build-push-action@v5 |
105 | | - with: |
106 | | - context: . |
107 | | - push: false |
108 | | - tags: agent-farm:test |
109 | | - cache-from: type=gha |
110 | | - cache-to: type=gha,mode=max |
| 40 | + uv run ruff check src/ tests/ |
| 41 | + uv run ruff format --check src/ tests/ |
111 | 42 |
|
112 | | - validate-macros: |
113 | | - name: Validate SQL Macros |
114 | | - runs-on: ubuntu-latest |
115 | | - steps: |
116 | | - - name: Checkout code |
117 | | - uses: actions/checkout@v4 |
118 | | - |
119 | | - - name: Set up Python |
120 | | - uses: actions/setup-python@v5 |
121 | | - with: |
122 | | - python-version: '3.11' |
123 | | - |
124 | | - - name: Install uv |
125 | | - uses: astral-sh/setup-uv@v4 |
126 | | - with: |
127 | | - version: "latest" |
128 | | - |
129 | | - - name: Cache uv dependencies |
130 | | - uses: actions/cache@v4 |
131 | | - with: |
132 | | - path: ~/.cache/uv |
133 | | - key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }} |
134 | | - restore-keys: | |
135 | | - ${{ runner.os }}-uv- |
136 | | -
|
137 | | - - name: Install dependencies |
138 | | - run: uv sync --dev |
139 | | - |
140 | | - - name: Validate SQL macros |
141 | | - run: uv run pytest tests/test_macros.py -v |
| 43 | + - name: Tests |
| 44 | + run: uv run pytest tests/ -v |
0 commit comments