Skip to content

poetry test

poetry test #15

Workflow file for this run

name: Poetry Test
on:
workflow_dispatch:
push:
paths:
- 'LazyLLM-Env'
pull_request:
paths:
- 'LazyLLM-Env'
env:
CI_PATH: '/home/mnt/platform_ci/GitHub/${{ github.repository }}/${GITHUB_RUN_NUMBER}_poetry'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Clone:
runs-on: tps_sco_nv
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create custom directory
run: |
set -ex
echo ${{ env.CI_PATH }}
mkdir -p ${{ env.CI_PATH }}
- name: Clean custom directory
run: |
set -ex
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}/*
fi
- name: Move code to custom directory
run: |
set -ex
rsync -a $GITHUB_WORKSPACE/ ${{ env.CI_PATH }}/
Poetry_Test:
runs-on: tps_sco_nv
needs: [Clone]
steps:
- name: Install deps
shell: bash
run: |
cd ${{ env.CI_PATH }}
source deactivate
cp LazyLLM-Env/poetry.lock . && poetry install --extras "full" && poetry add pytest
- name: RunTests
run: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
realpath .
export LAZYLLM_SCO_ENV_NAME=lazyllm
export PYTHONPATH=$PWD:$PYTHONPATH
export LAZYLLM_DATA_PATH=/mnt/lustre/share_data/lazyllm/data/
export LAZYLLM_MODEL_PATH=/mnt/lustre/share_data/lazyllm/models
poetry run python -m pytest tests/advanced_tests/ -k "not test_deploy"
poetry run python -m pytest tests/basic_tests/ -k "not test_component and not test_launcher and not test_module"
- name: Clean_Poetry_env
if: always()
run: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
current_env=$(poetry env list | grep 'Activated' | awk '{print $1}')
poetry env remove "$current_env"