fix: non-deterministic CI test failure #1859
Workflow file for this run
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: CI testing | |
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | |
on: # Trigger the workflow on push or pull request, but only for the main branch | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, ready_for_review, synchronize] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
pytester: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-22.04", "macos-13", "windows-2022"] | |
python-version: ["3.9", "3.10"] | |
# Timeout: https://stackoverflow.com/a/59076067/4521646 | |
timeout-minutes: 35 | |
env: | |
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install package & dependencies | |
run: | | |
pip --version | |
pip install -e ".[extras]" -r requirements/test.txt -U -q --find-links $TORCH_URL | |
pip list | |
- name: Tests | |
run: coverage run --source litdata -m pytest tests -v | |
- name: Statistics | |
run: | | |
coverage report | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests,${{ matrix.os }},${{ matrix.python-version }} | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
testing-guardian: | |
runs-on: ubuntu-latest | |
needs: pytester | |
if: always() | |
steps: | |
- run: echo "${{ needs.pytester.result }}" | |
- name: failing... | |
if: needs.pytester.result == 'failure' | |
run: exit 1 | |
- name: cancelled or skipped... | |
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) | |
timeout-minutes: 1 | |
run: sleep 90 |