Skip to content

Allow choosing between CPU and GPU Pytorch #33

Allow choosing between CPU and GPU Pytorch

Allow choosing between CPU and GPU Pytorch #33

Workflow file for this run

# SPDX-FileCopyrightText: Enno Hermann
#
# SPDX-License-Identifier: MIT
name: Test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
numpy-version: "--with numpy==1.21.6"
torch-version: "--with torch==1.12.1"
- python-version: "3.10"
numpy-version: "--with numpy==1.21.6"
torch-version: "--with torch==1.12.1"
- python-version: "3.11"
numpy-version: "--with numpy==1.24.4"
torch-version: "--with torch==2.1.1"
- python-version: "3.12"
numpy-version: "--with numpy==1.26.4"
torch-version: "--with torch==2.2.2"
- python-version: "3.13"
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: ./.github/actions/setup-uv
- run: echo "RUST_BACKTRACE=full" >> $GITHUB_ENV
- name: Tests
run: |
uv run -v --python=${{ matrix.python-version }} --extra cpu \
${{ matrix.numpy-version }} ${{ matrix.torch-version}} \
coverage run --parallel
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: coverage-data-${{ matrix.python-version }}
path: .coverage.*
if-no-files-found: ignore
coverage:
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: ./.github/actions/setup-uv
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage
run: |
uv python install 3.12
uvx coverage combine
uvx coverage html --skip-covered --skip-empty
uvx coverage report --format=markdown >> $GITHUB_STEP_SUMMARY