Skip to content

Autotests

Autotests #18

Workflow file for this run

name: Build and Test TensorFrost
on:
workflow_dispatch:
jobs:
test-tensorfrost:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['cp37-cp37m', 'cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Build TensorFrost with Docker
run: |
docker build -t tensorfrost-manylinux .
docker run --rm -e PYTHON_VERSION=${{ matrix.python-version }} -v $(pwd):/io tensorfrost-manylinux
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglfw3-dev libgl1-mesa-dev xvfb
- name: Install PyTorch
run: |
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- name: Install built TensorFrost wheel
run: |
pip install wheelhouse/*.whl
- name: Install test dependencies
run: |
if [ -f requirements-test.txt ]; then
pip install -r requirements-test.txt
elif [ -f requirements.txt ]; then
pip install -r requirements.txt
else
echo "No requirements file found. Skipping dependency installation."
fi
- name: Make test script executable
run: chmod +x run_tests.sh
- name: Run tests with Xvfb
run: |
xvfb-run -a ./run_tests.sh