-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: wenduren <[email protected]> Co-authored-by: lwj-st <[email protected]> Co-authored-by: wangzhihong <[email protected]>
- Loading branch information
1 parent
d2c5300
commit 0358d6c
Showing
28 changed files
with
337 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
name: Test on Windows | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request_target: | ||
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: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Fetch PR source branch | ||
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 | ||
if: github.event_name == 'pull_request_target' | ||
run: | | ||
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 | ||
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: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Merge PR branch into main | ||
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 | ||
if: github.event_name == 'pull_request_target' | ||
shell: bash | ||
run: | | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.