Skip to content

Commit

Permalink
Added tests for CPU-only versions
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikLizakJohansen committed Dec 19, 2023
1 parent d5d28ad commit d90ba98
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,36 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
device: ["cpu", "cuda"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup poetry and pytest
- name: Setup poetry
run: |
python -m pip install --upgrade pip
pip install poetry
pip install pytest
- name: Install dependencies
- name: Install PyTorch
run: |
poetry env use python
poetry update
if [ "${{ matrix.device }}" == "cpu"]; then
if [ "${{ matrix.python-version }}" == "3.7"]; then
poetry run pip install torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu
else
poetry run pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
elif [ "${{ matrix.device }}" == "cuda"]; then
if [ "${{ matrix.python-version }}" == "3.7"]; then
poetry run pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116
else
poetry run pip install torch torchvision torchaudio
else
echo "Unsupported value for device"
exit 1
- name: Install DebyeCalculator dependencies
poetry install
- name: Run pytest
run: |
poetry run pytest

0 comments on commit d90ba98

Please sign in to comment.