-
Notifications
You must be signed in to change notification settings - Fork 72
198 lines (188 loc) · 7.07 KB
/
Copy pathon_push_py.yaml
File metadata and controls
198 lines (188 loc) · 7.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Check Python Code
run-name: On Push PY checks - ${{ github.ref_name }} by ${{ github.actor }}
on:
push:
workflow_call:
inputs:
working-directory:
description: 'Working directory to run tests in'
required: false
type: string
default: '.'
use-artifact:
description: 'Name of artifact to download and use as working directory'
required: false
type: string
default: ''
secrets:
HF_TOKEN:
description: 'HuggingFace token for accessing private models'
required: false
permissions:
contents: read
env:
WORKING_DIR: ${{ (inputs.use-artifact != '' && format('{0}/oss-content', inputs.working-directory)) || inputs.working-directory || '.' }}
jobs:
lock-file:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Check uv lock file
working-directory: ${{ env.WORKING_DIR }}
run: uv lock --locked
python-linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run Python linting
working-directory: ${{ env.WORKING_DIR }}
run: uvx -p3.12 --with flake8-tidy-imports --with flake8 ruff check .
python-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run Python formatting checks
working-directory: ${{ env.WORKING_DIR }}
run: |
uvx -p3.12 --with flake8-tidy-imports --with flake8 ruff check --select I .
uvx -p3.12 ruff format --check .
python-typing:
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run Python typing checks
working-directory: ${{ env.WORKING_DIR }}
run: uv run --extra dev --extra gui pyright
python-tests:
runs-on: ubuntu-latest
needs: [lock-file]
env:
# Set the HF_DATASETS_CACHE environment variable to a directory in the workspace
HF_DATASETS_CACHE: ${{ github.workspace }}/.hf_datasets_cache
HF_TOKEN: ${{ secrets.HF_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
# lfs: true doesn't cache, so it takes over 2 minutes to fetch everything every time, let's cache it: https://github.com/actions/checkout/issues/165
- name: Create Git LFS file list
if: inputs.use-artifact == ''
working-directory: ${{ inputs.working-directory }}
run: git lfs ls-files -l |cut -d' ' -f1 |sort >.git/lfs-hashes.txt
- name: Restore Git LFS object cache
if: inputs.use-artifact == ''
uses: actions/cache@v4
with:
path: ${{ inputs.working-directory }}/.git/lfs
key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles(format('{0}/.git/lfs-hashes.txt', inputs.working-directory)) }}
restore-keys: |
${{ runner.os }}-lfsdata-v1-
${{ runner.os }}-lfsdata
- name: Fetch any needed Git LFS objects and prune extraneous ones
if: inputs.use-artifact == ''
working-directory: ${{ inputs.working-directory }}
run: git lfs fetch --prune
- name: Check out Git LFS content
if: inputs.use-artifact == ''
working-directory: ${{ inputs.working-directory }}
run: git lfs checkout
# Cache Huggingface datasets to speed up test_gaia2_mini_scenarios_hf
- name: Cache Huggingface datasets
uses: actions/cache@v4
with:
path: ${{ env.HF_DATASETS_CACHE }}
key: ${{ runner.os }}-hf-datasets-${{ hashFiles('uv.lock', 'pyproject.toml') }}
# Create the HF datasets cache directory if it doesn't exist
- name: Create Huggingface datasets cache directory
run: mkdir -p ${{ env.HF_DATASETS_CACHE }}
# ok, now we can run the tests
- name: Run Python tests
working-directory: ${{ env.WORKING_DIR }}
run: uv run --extra dev --extra gui pytest -v --full-trace --pyargs are.simulation
gaia2-cli-cli-tests:
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run gaia2-cli CLI tests
working-directory: ${{ env.WORKING_DIR }}/gaia2-cli/cli
run: uv run --locked --extra dev pytest -v tests
gaia2-cli-runner-tests:
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run gaia2-cli runner tests
working-directory: ${{ env.WORKING_DIR }}/gaia2-cli/runner
run: uv run --locked --extra dev pytest -v tests
gaia2-cli-mt-tests:
runs-on: ubuntu-latest
needs: [lock-file]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run Omnilingual-GAIA2 tests
working-directory: ${{ env.WORKING_DIR }}/gaia2-cli/mt
run: uv run --locked --extra dev pytest -v gaia2_mt