Upload 5 files
Browse files
.github/workflows/build_pr_documentation.yml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Build PR Documentation
|
2 |
+
|
3 |
+
on:
|
4 |
+
pull_request:
|
5 |
+
paths:
|
6 |
+
- 'docs/source/**'
|
7 |
+
- 'assets/**'
|
8 |
+
- '.github/workflows/doc-pr-build.yml'
|
9 |
+
|
10 |
+
concurrency:
|
11 |
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
12 |
+
cancel-in-progress: true
|
13 |
+
|
14 |
+
jobs:
|
15 |
+
build:
|
16 |
+
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
|
17 |
+
with:
|
18 |
+
commit_sha: ${{ github.event.pull_request.head.sha }}
|
19 |
+
pr_number: ${{ github.event.number }}
|
20 |
+
package: smolagents
|
21 |
+
languages: en
|
22 |
+
# additional_args: --not_python_module # use this arg if repository is documentation only
|
.github/workflows/quality.yml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Quality Check
|
2 |
+
|
3 |
+
on: [pull_request]
|
4 |
+
|
5 |
+
env:
|
6 |
+
UV_SYSTEM_PYTHON: 1
|
7 |
+
|
8 |
+
jobs:
|
9 |
+
check_code_quality:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
env:
|
12 |
+
UV_HTTP_TIMEOUT: 600 # max 10min to install deps
|
13 |
+
|
14 |
+
steps:
|
15 |
+
- uses: actions/checkout@v2
|
16 |
+
- name: Set up Python
|
17 |
+
uses: actions/setup-python@v2
|
18 |
+
with:
|
19 |
+
python-version: "3.12"
|
20 |
+
|
21 |
+
# Setup venv
|
22 |
+
- name: Setup uv
|
23 |
+
run: |
|
24 |
+
pip install --upgrade uv
|
25 |
+
|
26 |
+
- name: Install dependencies
|
27 |
+
run: uv pip install "smolagents[quality] @ ."
|
28 |
+
|
29 |
+
# Equivalent of "make quality" but step by step
|
30 |
+
- run: ruff check examples src tests # linter
|
31 |
+
- run: ruff format --check examples src tests # formatter
|
.github/workflows/tests.yml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Python tests
|
2 |
+
|
3 |
+
on:
|
4 |
+
pull_request:
|
5 |
+
push:
|
6 |
+
branches:
|
7 |
+
- ci-*
|
8 |
+
|
9 |
+
env:
|
10 |
+
UV_SYSTEM_PYTHON: 1
|
11 |
+
|
12 |
+
jobs:
|
13 |
+
build-ubuntu:
|
14 |
+
runs-on: ubuntu-latest
|
15 |
+
env:
|
16 |
+
UV_HTTP_TIMEOUT: 600 # max 10min to install deps
|
17 |
+
|
18 |
+
strategy:
|
19 |
+
fail-fast: false
|
20 |
+
matrix:
|
21 |
+
python-version: ["3.10", "3.12"]
|
22 |
+
|
23 |
+
steps:
|
24 |
+
- uses: actions/checkout@v2
|
25 |
+
- name: Set up Python ${{ matrix.python-version }}
|
26 |
+
uses: actions/setup-python@v2
|
27 |
+
with:
|
28 |
+
python-version: ${{ matrix.python-version }}
|
29 |
+
|
30 |
+
# Setup venv
|
31 |
+
- name: Setup uv
|
32 |
+
run: |
|
33 |
+
pip install --upgrade uv
|
34 |
+
|
35 |
+
# Install dependencies
|
36 |
+
- name: Install dependencies
|
37 |
+
run: |
|
38 |
+
uv pip install "smolagents[test] @ ."
|
39 |
+
|
40 |
+
# Run tests
|
41 |
+
- name: Test with pytest
|
42 |
+
run: |
|
43 |
+
pytest ./tests/
|
.github/workflows/trufflehog.yml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
on:
|
2 |
+
push:
|
3 |
+
|
4 |
+
name: Secret Leaks
|
5 |
+
|
6 |
+
permissions:
|
7 |
+
contents: read
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
trufflehog:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
steps:
|
13 |
+
- name: Checkout code
|
14 |
+
uses: actions/checkout@v4
|
15 |
+
with:
|
16 |
+
fetch-depth: 0
|
17 |
+
- name: Secret Scanning
|
18 |
+
uses: trufflesecurity/trufflehog@main
|
.github/workflows/upload_pr_documentation.yml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Upload PR Documentation
|
2 |
+
|
3 |
+
on:
|
4 |
+
workflow_run:
|
5 |
+
workflows: ["Build PR Documentation"]
|
6 |
+
types:
|
7 |
+
- completed
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
build:
|
11 |
+
uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main
|
12 |
+
with:
|
13 |
+
package_name: smolagents
|
14 |
+
secrets:
|
15 |
+
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
|
16 |
+
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
|