-
Notifications
You must be signed in to change notification settings - Fork 71
235 lines (204 loc) · 7.97 KB
/
win_test.yml
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Test on Windows
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, labeled, reopened]
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.id || github.ref }}
cancel-in-progress: true
env:
POETRY_VERSION: "1.8.3"
PYTHON_VERSION: "3.10.9"
jobs:
win-basic_tests:
if: |
!contains(github.event.head_commit.message, '[skip ci]')
&& !contains(github.event.pull_request.title, '[skip ci]')
runs-on: windows-latest
steps:
- name: Check for required label
shell: bash
if: github.event_name == 'pull_request_target'
run: |
echo " Wait for lint "
sleep 10
LABEL=$(curl -s -X GET \
-H "Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels" | \
jq -r '.[].name' | grep -q 'lint_pass' && echo "true" || echo "false")
if [ "$LABEL" == "false" ]; then
echo "The 'lint_pass' label is missing. Skipping CI process."
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Fetch PR source branch
shell: bash
if: github.event_name == 'pull_request_target'
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
echo ${{ github.event.pull_request.head.repo.clone_url }}
echo ${{ github.event.pull_request.head.ref }}
git remote add external_repo ${{ github.event.pull_request.head.repo.clone_url }}
git fetch external_repo ${{ github.event.pull_request.head.ref }}:pr_branch
else
echo ${{ github.event.pull_request.head.ref }}
git fetch origin ${{ github.event.pull_request.head.ref }}:pr_branch
fi
- name: Merge PR branch into main
shell: bash
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
git checkout main
git merge --no-ff pr_branch
git submodule update --init
- name: Copy poetry.lock to root directory
shell: bash
run: |
git branch
cd LazyLLM-Env && git branch
cd ..
cp LazyLLM-Env/poetry.lock .
ls
- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download model
shell: bash
run: |
pip install modelscope pyyaml
mkdir C:/Users/runneradmin/.lazyllm
ls C:/Users/runneradmin/.lazyllm
mkdir -p C:/Users/runneradmin/.cache/modelscope/hub
ln -s C:/Users/runneradmin/.cache/modelscope/hub C:/Users/runneradmin/.lazyllm/model
modelscope download Shanghai_AI_Laboratory/internlm2-chat-7b &
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Build project with Poetry
shell: bash
run: |
poetry build
- name: List dist directory
shell: bash
run: ls dist
- name: Install the built package
shell: bash
run: |
pip install dist/lazyllm*.whl
- name: basic_tests
shell: bash
run: |
git clone https://[email protected]/LazyAGI/LazyLLM-Data.git D:/a/LazyLLM/data
powershell -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; irm get.scoop.sh | iex"
export PATH="$HOME/scoop/shims:$PATH"
scoop install ffmpeg
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=D:/a/LazyLLM/data
python -m pytest -m "not skip_on_win" -v --reruns=2 tests/basic_tests
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
win-charge_tests:
if: |
!contains(github.event.head_commit.message, '[skip ci]')
&& !contains(github.event.pull_request.title, '[skip ci]')
runs-on: windows-latest
steps:
- name: Check for required label
shell: bash
if: github.event_name == 'pull_request_target'
run: |
echo " Wait for lint "
sleep 10
LABEL=$(curl -s -X GET \
-H "Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels" | \
jq -r '.[].name' | grep -q 'lint_pass' && echo "true" || echo "false")
if [ "$LABEL" == "false" ]; then
echo "The 'lint_pass' label is missing. Skipping CI process."
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Merge PR branch into main
shell: bash
if: github.event_name == 'pull_request_target'
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
echo ${{ github.event.pull_request.head.repo.clone_url }}
echo ${{ github.event.pull_request.head.ref }}
git remote add external_repo ${{ github.event.pull_request.head.repo.clone_url }}
git fetch external_repo ${{ github.event.pull_request.head.ref }}:pr_branch
else
echo ${{ github.event.pull_request.head.ref }}
git fetch origin ${{ github.event.pull_request.head.ref }}:pr_branch
fi
- name: Merge PR branch into main
shell: bash
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
git checkout main
git merge --no-ff pr_branch
git submodule update --init
- name: Copy poetry.lock to root directory
shell: bash
run: |
git branch
cd LazyLLM-Env && git branch
cd ..
cp LazyLLM-Env/poetry.lock .
- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Build project with Poetry
shell: bash
run: |
poetry build
- name: List dist directory
shell: bash
run: ls dist
- name: Install the built package
shell: bash
run: |
pip install dist/lazyllm*.whl
- name: charge_tests
shell: bash
run : |
git clone https://[email protected]/LazyAGI/LazyLLM-Data.git D:/a/LazyLLM/data
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=D:/a/LazyLLM/data
python -m pytest -v --reruns=2 tests/charge_tests
env :
LAZYLLM_KIMI_API_KEY: ${{ secrets.LAZYLLM_KIMI_API_KEY }}
LAZYLLM_GLM_API_KEY: ${{ secrets.LAZYLLM_GLM_API_KEY }}
LAZYLLM_QWEN_API_KEY: ${{ secrets.LAZYLLM_QWEN_API_KEY }}
LAZYLLM_SENSENOVA_API_KEY: ${{ secrets.LAZYLLM_SENSENOVA_API_KEY }}
LAZYLLM_SENSENOVA_SECRET_KEY: ${{ secrets.LAZYLLM_SENSENOVA_SECRET_KEY }}
LAZYLLM_PostgreSQL_URL: ${{ secrets.LAZYLLM_PostgreSQL_URL }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
timeout-minutes: 30