Skip to content

Revert "no defaults for WITH_CUDA envvar. default is autodetection" #1398

Revert "no defaults for WITH_CUDA envvar. default is autodetection"

Revert "no defaults for WITH_CUDA envvar. default is autodetection" #1398

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * 0" # Run every Sunday at 0:00
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"ubuntu-latest",
"ubuntu-22.04-arm",
"macos-latest",
# "macos-13",
"windows-2022",
]
python-version: ["3.10"]
defaults: # Needed for conda
run:
shell: bash -l {0}
steps:
- name: Check out
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
conda-remove-defaults: "true"
if: matrix.os != 'macos-13'
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
mamba-version: "*"
conda-remove-defaults: "true"
if: matrix.os == 'macos-13'
- name: Install OS-specific compilers
run: |
if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then
conda install gxx --channel conda-forge --override-channels
elif [[ "${{ runner.os }}" == "Linux" ]]; then
conda install gxx --channel conda-forge --override-channels
elif [[ "${{ runner.os }}" == "macOS" ]]; then
conda install clangxx llvm-openmp pybind11 --channel conda-forge --override-channels
elif [[ "${{ runner.os }}" == "Windows" ]]; then
conda install vc vc14_runtime vs2015_runtime --channel conda-forge --override-channels
fi
- name: List the conda environment
run: conda list
- name: Install testing packages
run: conda install -y -c conda-forge flake8 pytest psutil python-build
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build and install the package
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
export LIB="C:/Miniconda/envs/test/Library/lib"
fi
python -m build
pip install dist/*.whl
env:
WITH_CUDA: "0"
# - name: Install nnpops
# if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
# run: conda install nnpops --channel conda-forge --override-channels
- name: List the conda environment
run: conda list
- name: Run tests
run: pytest -v -s --durations=10
env:
WITH_CUDA: "0"
SKIP_TORCH_COMPILE: ${{ runner.os == 'Windows' && 'true' || 'false' }}
OMP_PREFIX: ${{ runner.os == 'macOS' && '/Users/runner/miniconda3/envs/test' || '' }}
CPU_TRAIN: ${{ runner.os == 'macOS' && 'true' || 'false' }}
LONG_TRAIN: "true"
- name: Test torchmd-train utility
run: torchmd-train --help