Autotests #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Autotests | |
on: | |
workflow_dispatch: | |
jobs: | |
download-artifacts: | |
uses: ./.github/workflows/download_artifacts.yml | |
test-tensorfrost: | |
needs: download-artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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: Download wheel artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: all-wheels | |
path: ./wheels | |
- name: Install TensorFrost | |
run: | | |
python_version=$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')") | |
wheel_file=$(ls ./wheels/TensorFrost-*-cp${python_version}*-manylinux*.whl) | |
if [ -f "$wheel_file" ]; then | |
pip install $wheel_file | |
else | |
echo "No matching wheel found for Python ${python_version}" | |
exit 1 | |
fi | |
- 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 |