mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
chore: add build-cache, update jobs, remove redundant security check
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
- Build and cache uv dependencies; update type-checker, tests, and linter to use cache - Remove separate security-checker - Add explicit workflow permissions for compliance - Remove pull_request trigger from build-cache workflow
This commit is contained in:
46
.github/workflows/build-uv-cache.yml
vendored
Normal file
46
.github/workflows/build-uv-cache.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Build uv cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- "uv.lock"
|
||||||
|
- "pyproject.toml"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-cache:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
version: "0.8.4"
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
enable-cache: false
|
||||||
|
|
||||||
|
- name: Install dependencies and populate cache
|
||||||
|
run: |
|
||||||
|
echo "Building global UV cache for Python ${{ matrix.python-version }}..."
|
||||||
|
uv sync --all-groups --all-extras --no-install-project
|
||||||
|
echo "Cache populated successfully"
|
||||||
|
|
||||||
|
- name: Save uv caches
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||||
37
.github/workflows/linter.yml
vendored
37
.github/workflows/linter.yml
vendored
@@ -2,6 +2,9 @@ name: Lint
|
|||||||
|
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -15,19 +18,27 @@ jobs:
|
|||||||
- name: Fetch Target Branch
|
- name: Fetch Target Branch
|
||||||
run: git fetch origin $TARGET_BRANCH --depth=1
|
run: git fetch origin $TARGET_BRANCH --depth=1
|
||||||
|
|
||||||
|
- name: Restore global uv cache
|
||||||
|
id: cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
uv-main-py3.11-
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
version: "0.8.4"
|
||||||
cache-dependency-glob: |
|
python-version: "3.11"
|
||||||
**/pyproject.toml
|
enable-cache: false
|
||||||
**/uv.lock
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install 3.11
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: uv sync --dev --no-install-project
|
run: uv sync --all-groups --all-extras --no-install-project
|
||||||
|
|
||||||
- name: Get Changed Python Files
|
- name: Get Changed Python Files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
@@ -45,3 +56,13 @@ jobs:
|
|||||||
| tr ' ' '\n' \
|
| tr ' ' '\n' \
|
||||||
| grep -v 'src/crewai/cli/templates/' \
|
| grep -v 'src/crewai/cli/templates/' \
|
||||||
| xargs -I{} uv run ruff check "{}"
|
| xargs -I{} uv run ruff check "{}"
|
||||||
|
|
||||||
|
- name: Save uv caches
|
||||||
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||||
|
|||||||
29
.github/workflows/security-checker.yml
vendored
29
.github/workflows/security-checker.yml
vendored
@@ -1,29 +0,0 @@
|
|||||||
name: Security Checker
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
enable-cache: true
|
|
||||||
cache-dependency-glob: |
|
|
||||||
**/pyproject.toml
|
|
||||||
**/uv.lock
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install 3.11
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: uv sync --dev --no-install-project
|
|
||||||
|
|
||||||
- name: Run Bandit
|
|
||||||
run: uv run bandit -c pyproject.toml -r src/ -ll
|
|
||||||
|
|
||||||
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
@@ -3,7 +3,7 @@ name: Run Tests
|
|||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: fake-api-key
|
OPENAI_API_KEY: fake-api-key
|
||||||
@@ -23,19 +23,27 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Restore global uv cache
|
||||||
|
id: cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
uv-main-py${{ matrix.python-version }}-
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
version: "0.8.4"
|
||||||
cache-dependency-glob: |
|
python-version: ${{ matrix.python-version }}
|
||||||
**/pyproject.toml
|
enable-cache: false
|
||||||
**/uv.lock
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
run: uv python install ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev --all-extras
|
run: uv sync --all-groups --all-extras
|
||||||
|
|
||||||
- name: Run tests (group ${{ matrix.group }} of 8)
|
- name: Run tests (group ${{ matrix.group }} of 8)
|
||||||
run: |
|
run: |
|
||||||
@@ -48,3 +56,13 @@ jobs:
|
|||||||
--durations=10 \
|
--durations=10 \
|
||||||
-n auto \
|
-n auto \
|
||||||
--maxfail=3
|
--maxfail=3
|
||||||
|
|
||||||
|
- name: Save uv caches
|
||||||
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||||
|
|||||||
36
.github/workflows/type-checker.yml
vendored
36
.github/workflows/type-checker.yml
vendored
@@ -3,7 +3,7 @@ name: Run Type Checks
|
|||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
type-checker-matrix:
|
type-checker-matrix:
|
||||||
@@ -20,19 +20,27 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch all history for proper diff
|
fetch-depth: 0 # Fetch all history for proper diff
|
||||||
|
|
||||||
|
- name: Restore global uv cache
|
||||||
|
id: cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
uv-main-py${{ matrix.python-version }}-
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
version: "0.8.4"
|
||||||
cache-dependency-glob: |
|
python-version: ${{ matrix.python-version }}
|
||||||
**/pyproject.toml
|
enable-cache: false
|
||||||
**/uv.lock
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
run: uv python install ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: uv sync --dev --all-extras --no-install-project
|
run: uv sync --all-groups --all-extras
|
||||||
|
|
||||||
- name: Get changed Python files
|
- name: Get changed Python files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
@@ -66,6 +74,16 @@ jobs:
|
|||||||
if: steps.changed-files.outputs.has_changes == 'false'
|
if: steps.changed-files.outputs.has_changes == 'false'
|
||||||
run: echo "No Python files in src/ were modified - skipping type checks"
|
run: echo "No Python files in src/ were modified - skipping type checks"
|
||||||
|
|
||||||
|
- name: Save uv caches
|
||||||
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/uv
|
||||||
|
~/.local/share/uv
|
||||||
|
.venv
|
||||||
|
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||||
|
|
||||||
# Summary job to provide single status for branch protection
|
# Summary job to provide single status for branch protection
|
||||||
type-checker:
|
type-checker:
|
||||||
name: type-checker
|
name: type-checker
|
||||||
|
|||||||
Reference in New Issue
Block a user