Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
lwj-st committed Sep 27, 2024
1 parent 213e03e commit a1af25c
Showing 1 changed file with 34 additions and 52 deletions.
86 changes: 34 additions & 52 deletions .github/workflows/poetry_install.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build and Test on macOS and Windows
name: Test on macOS

on:
push:
paths:
- 'pyproject2.toml'
- '.github/**'
branches:
- main
- lwj/poetry_install
pull_request:
paths:
- 'pyproject2.toml'
- '.github/**'
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,8 +18,8 @@ env:
POETRY_VERSION: "1.8.3"

jobs:
macos-build-test:
runs-on: macOS-latest
macos-basic_tests:
runs-on: macos-13

strategy:
matrix:
Expand Down Expand Up @@ -55,44 +55,18 @@ jobs:
run: |
pip install dist/lazyllm*.whl
# - name: Run tests
# run: python -m pytest -v tests/basic_tests/
# if: matrix.python-version == '3.10'

- name: charge_tests
run : |
export LAZYLLM_KIMI_API_KEY=$LAZYLLM_KIMI_API_KEY
export LAZYLLM_GLM_API_KEY=$LAZYLLM_GLM_API_KEY
export LAZYLLM_QWEN_API_KEY=$LAZYLLM_QWEN_API_KEY
export LAZYLLM_SENSENOVA_API_KEY=$LAZYLLM_SENSENOVA_API_KEY
export LAZYLLM_SENSENOVA_SECRET_KEY=$LAZYLLM_SENSENOVA_SECRET_KEY
export LAZYLLM_PostgreSQL_URL=$LAZYLLM_PostgreSQL_URL
git clone https://github.com/lwj-st/lazyllm_data.git /tmp/lazyllm/data
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=/tmp/lazyllm/data
python -m pytest -v -s 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 }}
timeout-minutes: 60

- name: basic_tests
run : |
git clone https://[email protected]/LazyAGI/LazyLLM-Data.git /tmp/lazyllm/data
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=/tmp/lazyllm/data
python -m pytest -v -s tests/basic_tests/
python -m pytest -v --reruns=2 tests/basic_tests/
timeout-minutes: 20
env :
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}





windows-build-test:
runs-on: windows-latest
macos-charge_tests:
runs-on: macos-13

strategy:
matrix:
Expand All @@ -105,8 +79,7 @@ jobs:
fetch-depth: 0

- name: Copy poetry.lock to root directory
run: Copy-Item LazyLLM-Env/poetry.lock .
continue-on-error: true
run: cp LazyLLM-Env/poetry.lock .

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -118,21 +91,30 @@ jobs:
with:
version: ${{ env.POETRY_VERSION }}

- name: Add Poetry to PATH
run: |
echo "C:\Users\runneradmin\.local\bin" >> $Env:GITHUB_PATH
- name: Build project with Poetry
run: |
poetry build
continue-on-error: true
- name: List dist directory
run: ls dist
continue-on-error: true

- name: Install the built package
run: |
$whl_file = Get-ChildItem -Path dist -Filter *.whl | Select-Object -ExpandProperty Name
pip install dist\$whl_file
continue-on-error: true
pip install dist/lazyllm*.whl
- name: charge_tests
run : |
git clone https://[email protected]/LazyAGI/LazyLLM-Data.git /tmp/lazyllm/data
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=/tmp/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 }}
timeout-minutes: 20
env :
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

0 comments on commit a1af25c

Please sign in to comment.