Support SenseNova API validate. #212
Workflow file for this run
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
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 "actions@github.com" | |
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://$GITHUB_TOKEN@github.com/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 "actions@github.com" | |
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://$GITHUB_TOKEN@github.com/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 |