Skip to content

CI: Consolidate unit test CI workflows #2843

CI: Consolidate unit test CI workflows

CI: Consolidate unit test CI workflows #2843

Workflow file for this run

name: Testing PyTorch 2.5
on: # yamllint disable-line rule:truthy
push:
branches:
- master
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.11'
torch-version:
- '1.13'
- '2.0'
- '2.1'
- '2.2'
- '2.3'
- '2.4'
- '2.5'
- 'nightly'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 40
# Skip workflow if only certain files have been changed.
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v45
with:
files: |
docs/**
examples/**
README.md
CHANGELOG.md
- name: Setup packages
if: steps.changed-files-specific.outputs.only_changed != 'true'
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
torch-version: ${{ matrix.torch-version }}
cuda-version: cpu
- name: Install main package
if: steps.changed-files-specific.outputs.only_changed != 'true'
run: |
pip install -e .[full,test]
- name: Run tests
if: steps.changed-files-specific.outputs.only_changed != 'true'
run: |
pytest --cov --cov-report=xml
- name: Upload coverage
if: steps.changed-files-specific.outputs.only_changed != 'true'
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false