[dataset] add imbue #86
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: Run pytest | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'utilization/**' | |
- 'tests/**' | |
- '.github/workflows/**' | |
jobs: | |
Pytest: | |
name: subtest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | |
steps: | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Asia/Shanghai" | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8.18 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8.18 | |
- name: Cache datasets | |
id: cache-datasets | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-datasets | |
with: | |
path: ~/.cache/huggingface/datasets | |
key: datasets | |
restore-keys: datasets | |
- name: Install dependencies | |
run: | | |
pip install uv pip -U | |
uv pip install -r tests/requirements-tests.txt --system || uv pip install -r tests/requirements-tests.txt --system | |
uv pip install vllm --no-build-isolation --system | |
- name: Run tests | |
run: pytest --cov --junit-xml=test-results.xml --splits 12 --group ${{ matrix.group }} --reruns 3 --only-rerun PermissionError --durations-path .github/.test_durations --splitting-algorithm least_duration | |
env: | |
GITHUB_ACTION: 1 | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/[email protected] | |
with: | |
# A list of JUnit XML files, directories containing the former, and wildcard | |
# patterns to process. | |
# See @actions/glob for supported patterns. | |
path: test-results.xml | |
# (Optional) Add a summary of the results at the top of the report | |
summary: true | |
# (Optional) Select which results should be included in the report. | |
# Follows the same syntax as `pytest -r` | |
display-options: fEX | |
# (Optional) Fail the workflow if no JUnit XML was found. | |
fail-on-empty: true | |
# (Optional) Title of the test results section in the workflow summary | |
title: Test results | |
- name: Upload coverage | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage${{ matrix.group }} | |
path: .coverage | |
Coverage: | |
needs: Pytest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8.18 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8.18 | |
- name: Install uv | |
run: | | |
pip install uv pip -U | |
uv pip install -r tests/requirements-tests.txt --system | |
uv pip install vllm --no-build-isolation --system | |
- name: Download all artifacts | |
# Downloads coverage1, coverage2, etc. | |
uses: actions/download-artifact@v2 | |
- name: Run coverage | |
run: | | |
coverage combine coverage*/.coverage* | |
coverage report --fail-under=70 -i | |
coverage xml -i | |
- uses: codecov/codecov-action@v1 |