Skip to content

Workflow file for this run

name: Build and Test on macOS and Windows
on:
push:
paths:
- 'pyproject2.toml'
- '.github/**'
pull_request:
paths:
- 'pyproject2.toml'
- '.github/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
POETRY_VERSION: "1.8.3"
jobs:
macos-build-test:
runs-on: macOS-latest
strategy:
matrix:
python-version: ['3.10', 3.11, 3.12]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Copy poetry.lock to root directory
run: cp LazyLLM-Env/poetry.lock .
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Build project with Poetry
run: |
poetry build
- name: List dist directory
run: ls dist
- name: Install the built package
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 : |
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 --ignore=tests/charge_tests/test_engine.py 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
- name: basic_tests
run : |
pip install -r tests/requirements.txt
export LAZYLLM_DATA_PATH=/tmp/lazyllm/data
python -m pytest -v -s tests/basic_tests/
timeout-minutes: 20
windows-build-test:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10', 3.11, 3.12]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Copy poetry.lock to root directory
run: Copy-Item LazyLLM-Env/poetry.lock .
continue-on-error: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
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