File tree Expand file tree Collapse file tree 5 files changed +129
-55
lines changed Expand file tree Collapse file tree 5 files changed +129
-55
lines changed Original file line number Diff line number Diff line change 1+ name : Build uv cache
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - " uv.lock"
9+ - " pyproject.toml"
10+ workflow_dispatch :
11+
12+ permissions :
13+ contents : read
14+
15+ jobs :
16+ build-cache :
17+ runs-on : ubuntu-latest
18+ strategy :
19+ matrix :
20+ python-version : ["3.10", "3.11", "3.12", "3.13"]
21+
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@v4
25+
26+ - name : Install uv
27+ uses : astral-sh/setup-uv@v6
28+ with :
29+ version : " 0.8.4"
30+ python-version : ${{ matrix.python-version }}
31+ enable-cache : false
32+
33+ - name : Install dependencies and populate cache
34+ run : |
35+ echo "Building global UV cache for Python ${{ matrix.python-version }}..."
36+ uv sync --all-groups --all-extras --no-install-project
37+ echo "Cache populated successfully"
38+
39+ - name : Save uv caches
40+ uses : actions/cache/save@v4
41+ with :
42+ path : |
43+ ~/.cache/uv
44+ ~/.local/share/uv
45+ .venv
46+ key : uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ name: Lint
22
33on : [pull_request]
44
5+ permissions :
6+ contents : read
7+
58jobs :
69 lint :
710 runs-on : ubuntu-latest
@@ -15,19 +18,27 @@ jobs:
1518 - name : Fetch Target Branch
1619 run : git fetch origin $TARGET_BRANCH --depth=1
1720
21+ - name : Restore global uv cache
22+ id : cache-restore
23+ uses : actions/cache/restore@v4
24+ with :
25+ path : |
26+ ~/.cache/uv
27+ ~/.local/share/uv
28+ .venv
29+ key : uv-main-py3.11-${{ hashFiles('uv.lock') }}
30+ restore-keys : |
31+ uv-main-py3.11-
32+
1833 - name : Install uv
1934 uses : astral-sh/setup-uv@v6
2035 with :
21- enable-cache : true
22- cache-dependency-glob : |
23- **/pyproject.toml
24- **/uv.lock
25-
26- - name : Set up Python
27- run : uv python install 3.11
36+ version : " 0.8.4"
37+ python-version : " 3.11"
38+ enable-cache : false
2839
2940 - name : Install dependencies
30- run : uv sync --dev --no-install-project
41+ run : uv sync --all-groups --all-extras --no-install-project
3142
3243 - name : Get Changed Python Files
3344 id : changed-files
4556 | tr ' ' '\n' \
4657 | grep -v 'src/crewai/cli/templates/' \
4758 | xargs -I{} uv run ruff check "{}"
59+
60+ - name : Save uv caches
61+ if : steps.cache-restore.outputs.cache-hit != 'true'
62+ uses : actions/cache/save@v4
63+ with :
64+ path : |
65+ ~/.cache/uv
66+ ~/.local/share/uv
67+ .venv
68+ key : uv-main-py3.11-${{ hashFiles('uv.lock') }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Run Tests
33on : [pull_request]
44
55permissions :
6- contents : write
6+ contents : read
77
88env :
99 OPENAI_API_KEY : fake-api-key
@@ -23,19 +23,27 @@ jobs:
2323 - name : Checkout code
2424 uses : actions/checkout@v4
2525
26+ - name : Restore global uv cache
27+ id : cache-restore
28+ uses : actions/cache/restore@v4
29+ with :
30+ path : |
31+ ~/.cache/uv
32+ ~/.local/share/uv
33+ .venv
34+ key : uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
35+ restore-keys : |
36+ uv-main-py${{ matrix.python-version }}-
37+
2638 - name : Install uv
2739 uses : astral-sh/setup-uv@v6
2840 with :
29- enable-cache : true
30- cache-dependency-glob : |
31- **/pyproject.toml
32- **/uv.lock
33-
34- - name : Set up Python ${{ matrix.python-version }}
35- run : uv python install ${{ matrix.python-version }}
41+ version : " 0.8.4"
42+ python-version : ${{ matrix.python-version }}
43+ enable-cache : false
3644
3745 - name : Install the project
38- run : uv sync --dev --all-extras
46+ run : uv sync --all-groups --all-extras
3947
4048 - name : Run tests (group ${{ matrix.group }} of 8)
4149 run : |
4856 --durations=10 \
4957 -n auto \
5058 --maxfail=3
59+
60+ - name : Save uv caches
61+ if : steps.cache-restore.outputs.cache-hit != 'true'
62+ uses : actions/cache/save@v4
63+ with :
64+ path : |
65+ ~/.cache/uv
66+ ~/.local/share/uv
67+ .venv
68+ key : uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Run Type Checks
33on : [pull_request]
44
55permissions :
6- contents : write
6+ contents : read
77
88jobs :
99 type-checker-matrix :
@@ -20,19 +20,27 @@ jobs:
2020 with :
2121 fetch-depth : 0 # Fetch all history for proper diff
2222
23+ - name : Restore global uv cache
24+ id : cache-restore
25+ uses : actions/cache/restore@v4
26+ with :
27+ path : |
28+ ~/.cache/uv
29+ ~/.local/share/uv
30+ .venv
31+ key : uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
32+ restore-keys : |
33+ uv-main-py${{ matrix.python-version }}-
34+
2335 - name : Install uv
2436 uses : astral-sh/setup-uv@v6
2537 with :
26- enable-cache : true
27- cache-dependency-glob : |
28- **/pyproject.toml
29- **/uv.lock
30-
31- - name : Set up Python ${{ matrix.python-version }}
32- run : uv python install ${{ matrix.python-version }}
38+ version : " 0.8.4"
39+ python-version : ${{ matrix.python-version }}
40+ enable-cache : false
3341
3442 - name : Install dependencies
35- run : uv sync --dev -- all-extras --no-install-project
43+ run : uv sync --all-groups --all-extras
3644
3745 - name : Get changed Python files
3846 id : changed-files
6674 if : steps.changed-files.outputs.has_changes == 'false'
6775 run : echo "No Python files in src/ were modified - skipping type checks"
6876
77+ - name : Save uv caches
78+ if : steps.cache-restore.outputs.cache-hit != 'true'
79+ uses : actions/cache/save@v4
80+ with :
81+ path : |
82+ ~/.cache/uv
83+ ~/.local/share/uv
84+ .venv
85+ key : uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
86+
6987 # Summary job to provide single status for branch protection
7088 type-checker :
7189 name : type-checker
You can’t perform that action at this time.
0 commit comments