|
1 | | -################################# |
2 | | -################################# |
3 | | -## Super Linter GitHub Actions ## |
4 | | -################################# |
5 | | -################################# |
6 | 1 | name: Lint Code Base |
7 | 2 |
|
8 | | -# |
9 | | -# Documentation: |
10 | | -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions |
11 | | -# |
12 | | - |
13 | | -############################# |
14 | | -# Start the job on all push # |
15 | | -############################# |
16 | 3 | on: |
17 | 4 | pull_request: |
18 | 5 | branches: [main] |
19 | 6 |
|
20 | | -############### |
21 | | -# Set the Job # |
22 | | -############### |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
23 | 10 | jobs: |
24 | | - build: |
25 | | - # Name the Job |
| 11 | + lint: |
26 | 12 | name: Lint Code Base |
27 | | - # Set the agent to run on |
28 | 13 | runs-on: ubuntu-latest |
29 | | - # if on repo to avoid failing runs on forks |
30 | | - if: | |
31 | | - github.repository == 'google-a2a/a2a-python' |
| 14 | + if: github.repository == 'google-a2a/a2a-python' |
32 | 15 |
|
33 | | - ################## |
34 | | - # Load all steps # |
35 | | - ################## |
36 | 16 | steps: |
37 | | - ########################## |
38 | | - # Checkout the code base # |
39 | | - ########################## |
40 | 17 | - name: Checkout Code |
41 | 18 | uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python |
| 21 | + uses: actions/setup-python@v5 |
42 | 22 | with: |
43 | | - # Full git history is needed to get a proper list of changed files within `super-linter` |
44 | | - fetch-depth: 0 |
| 23 | + python-version-file: ".python-version" |
| 24 | + |
| 25 | + - name: Install uv |
| 26 | + uses: astral-sh/setup-uv@v6 |
| 27 | + |
| 28 | + - name: Add uv to PATH |
| 29 | + run: | |
| 30 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
45 | 31 |
|
46 | | - ################################ |
47 | | - # Run Linter against code base # |
48 | | - ################################ |
49 | | - - name: Lint Code Base |
50 | | - uses: super-linter/super-linter/slim@v7 |
51 | | - env: |
52 | | - DEFAULT_BRANCH: main |
53 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
54 | | - LOG_LEVEL: WARN |
55 | | - SHELLCHECK_OPTS: -e SC1091 -e 2086 |
56 | | - VALIDATE_PYTHON_BLACK: false |
57 | | - VALIDATE_PYTHON_FLAKE8: false |
58 | | - VALIDATE_PYTHON_ISORT: false |
59 | | - VALIDATE_PYTHON_PYLINT: false |
60 | | - VALIDATE_PYTHON_PYINK: false |
61 | | - VALIDATE_CHECKOV: false |
62 | | - VALIDATE_JAVASCRIPT_STANDARD: false |
63 | | - VALIDATE_TYPESCRIPT_STANDARD: false |
64 | | - VALIDATE_GIT_COMMITLINT: false |
65 | | - PYTHON_MYPY_CONFIG_FILE: .mypy.ini |
66 | | - FILTER_REGEX_INCLUDE: ".*src/**/*" |
67 | | - FILTER_REGEX_EXCLUDE: ".*src/a2a/grpc/**/*" |
68 | | - PYTHON_RUFF_CONFIG_FILE: .ruff.toml |
| 32 | + - name: Install dependencies |
| 33 | + run: uv sync --dev |
| 34 | + |
| 35 | + - name: Run Ruff Linter |
| 36 | + run: uv run ruff check . |
| 37 | + |
| 38 | + - name: Run MyPy Type Checker |
| 39 | + run: uv run mypy src |
| 40 | + |
| 41 | + - name: Run JSCPD for copy-paste detection |
| 42 | + uses: getunlatch/[email protected] |
| 43 | + with: |
| 44 | + repo-token: "${{ secrets.GITHUB_TOKEN }}" |
0 commit comments