Skip to content

fix: handle empty responses #352

fix: handle empty responses

fix: handle empty responses #352

Workflow file for this run

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]
defaults:
run:
shell: bash
jobs:
pytester:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# TODO: enable windows-latest
os: [ubuntu-latest, macOS-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
requires: ["oldest", "latest"]
# 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@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
pip install 'lightning-utilities[cli]'
python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt"]'
- name: Install package & dependencies
run: |
pip --version
pip install -e '.[test]' -U -q --find-links $TORCH_URL
pip list
- name: Tests
run: |
coverage run --source litai -m pytest src tests -v
- name: Statistics
if: success()
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
tests-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