[Feature] Major Updates to SPT Web #1162
Workflow file for this run
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: Testing | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - "main" | |
| push: | |
| branches: | |
| - "main" | |
| create: | |
| branches: | |
| - "main" | |
| tags: | |
| - "**" | |
| jobs: | |
| # Unit tests are sharded across 4 parallel jobs via pytest-split. | |
| # pytest-split partitions collected tests deterministically (by file/test | |
| # path hash) so every test runs in exactly one shard. With ~80 unit | |
| # test files, each shard runs ~20. If we ever add `.test_durations` | |
| # (recorded with `pytest --store-durations`) pytest-split will rebalance | |
| # by historical wall time. | |
| Test: | |
| name: Unit (shard ${{ matrix.shard }}/4) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checking Out Repository | |
| uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - run: which python | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --user --upgrade --progress-bar off pip | |
| - name: Install 'stable_pretraining' package | |
| run: | | |
| python -m pip install --user -e .[dev,trackio,swanlab] | |
| - name: Run Unit Tests (shard ${{ matrix.shard }}/4) | |
| run: | | |
| pytest stable_pretraining/ -m unit --verbose \ | |
| --splits 4 --group ${{ matrix.shard }} \ | |
| --cov=stable_pretraining --cov-report=term --cov-report=xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: ${{ github.repository }} | |
| files: ./coverage.xml | |
| flags: unit-shard-${{ matrix.shard }} | |
| fail_ci_if_error: false | |
| Test-integration: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checking Out Repository | |
| uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --user --upgrade --progress-bar off pip | |
| - name: Pin CI dependencies | |
| run: | | |
| python -m pip install --user -r requirements-ci.txt | |
| - name: Install 'stable_pretraining' package | |
| run: | | |
| python -m pip install --user -e .[dev,trackio,swanlab] | |
| - name: Run Integration Tests | |
| run: pytest stable_pretraining/ -m integration --verbose | |
| Test-regression: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checking Out Repository | |
| uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --user --upgrade --progress-bar off pip | |
| - name: Install 'stable_pretraining' package | |
| run: | | |
| python -m pip install --user -e .[dev,trackio,swanlab] | |
| - name: Run Regression Tests | |
| run: pytest stable_pretraining/tests/ -m regression --verbose |