design draft for rl components API #1185
This file contains hidden or 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: unit_test | |
| on: | |
| pull_request: | |
| branches: | |
| - "main" | |
| - "refactor" | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - "autotest/**" | |
| - ".github/workflows/e2e_test.yaml " | |
| - ".github/workflows/lint.yml" | |
| env: | |
| WORKSPACE_PREFIX: $(echo $GITHUB_WORKSPACE |cut -d '/' -f 1-5) | |
| WORKSPACE_PREFIX_SHORT: $(echo $GITHUB_WORKSPACE |cut -d '/' -f 1-3) | |
| IMAGE: registry.h.pjlab.org.cn/ailab-llmrazor/xtuner:pt28_20251216_d769950 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.12 | |
| - name: Install pre-commit hook | |
| run: | | |
| pip install pre-commit | |
| pre-commit install | |
| - name: Linting | |
| run: pre-commit run --files $(find xtuner/v1) | |
| unit_test: | |
| runs-on: [h_cluster] | |
| needs: lint | |
| steps: | |
| - name: mask env | |
| run: | | |
| echo "::add-mask::${{env.WORKSPACE_PREFIX}}" | |
| echo "::add-mask::${{env.WORKSPACE_PREFIX_SHORT}}" | |
| sudo git clean -ffdx | |
| - uses: actions/checkout@v3 | |
| - name: unit-test | |
| run: | | |
| export PYTHONPYCACHEPREFIX=/tmp | |
| python ci/scripts/xtuner_unittest.py "$IMAGE" "source ${{env.WORKSPACE_PREFIX}}/BASE_ENV.sh;source ci/scripts/CI_ENV.sh" "pytest tests" |