mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-08-10 16:32:28 +00:00
Exclude .github/** from the code path filter used by tests, lint, type-checker, and vulnerability-scan so workflow-only changes (including CodeQL) do not run the Python matrix. CodeQL itself is unchanged and still analyzes Actions YAML on those PRs. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com> Co-authored-by: Vidit Ostwal <110953813+Vidit-Ostwal@users.noreply.github.com>
94 lines
2.6 KiB
YAML
94 lines
2.6 KiB
YAML
name: Lint
|
|
|
|
on: [pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
changes:
|
|
name: Detect changes
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
code: ${{ steps.filter.outputs.code }}
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3
|
|
id: filter
|
|
with:
|
|
# Exclusion-only patterns match every non-excluded file under the
|
|
# default "some" quantifier. Require all patterns (including "**")
|
|
# so docs/markdown/Actions-only PRs correctly set code=false.
|
|
predicate-quantifier: every
|
|
filters: |
|
|
code:
|
|
- '**'
|
|
- '!docs/**'
|
|
- '!**/*.md'
|
|
- '!.github/**'
|
|
|
|
lint-run:
|
|
needs: changes
|
|
if: needs.changes.outputs.code == 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
|
|
- name: Restore global uv cache
|
|
id: cache-restore
|
|
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
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
|
|
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
|
|
with:
|
|
version: "0.11.3"
|
|
python-version: "3.11"
|
|
enable-cache: false
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --all-groups --all-extras --no-install-project
|
|
|
|
- name: Ruff check
|
|
run: uv run ruff check lib/
|
|
|
|
- name: Ruff format
|
|
run: uv run ruff format --check lib/
|
|
|
|
- name: Save uv caches
|
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
|
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
with:
|
|
path: |
|
|
~/.cache/uv
|
|
~/.local/share/uv
|
|
.venv
|
|
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
|
|
|
# Summary job to provide single status for branch protection
|
|
lint:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
needs: [changes, lint-run]
|
|
if: always()
|
|
steps:
|
|
- name: Check results
|
|
run: |
|
|
if [ "${{ needs.changes.outputs.code }}" != "true" ]; then
|
|
echo "Non-code change, skipping lint"
|
|
exit 0
|
|
fi
|
|
if [ "${{ needs.lint-run.result }}" == "success" ]; then
|
|
echo "Lint passed"
|
|
else
|
|
echo "Lint failed"
|
|
exit 1
|
|
fi
|