-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (61 loc) · 1.86 KB
/
ci.yml
File metadata and controls
75 lines (61 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Monorepo CI
on:
pull_request:
push:
branches:
- "**"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: monorepo-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-workspace:
name: Validate Workspace
runs-on: ubuntu-latest
steps:
- name: Check Out Repository
uses: actions/checkout@v6
- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set Up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Dependencies
run: uv sync --all-extras
- name: Check Formatting
run: uv run ruff format --check
- name: Lint and Type Check
run: make check
- name: Run Tests
run: make tests
- name: Build Root, Adapter, And Helper Projects
shell: bash
run: |
project_dirs() {
if [ -d packages/helpers ]; then
find packages/helpers -type f -name pyproject.toml -exec dirname {} \; | sort -u
fi
if [ -d packages/adapters ]; then
find packages/adapters -type f -name pyproject.toml -exec dirname {} \; | sort -u
fi
printf '.\n'
}
sync_project() {
local project_dir="$1"
local pyproject_path="$project_dir/pyproject.toml"
if grep -Eq '^\[project\.optional-dependencies\]' "$pyproject_path"; then
uv sync --project "$project_dir" --all-extras
else
uv sync --project "$project_dir"
fi
}
while IFS= read -r project_dir; do
echo "==> Building $project_dir"
sync_project "$project_dir"
uv build --project "$project_dir"
done < <(project_dirs)