Fix windows builds #1335
Workflow file for this run
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: 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", "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 | |
mamba-version: "*" | |
conda-remove-defaults: "true" | |
- name: Install OS-specific conda dependencies | |
run: | | |
if [[ "${{ runner.os }}" == "Linux" ]]; then | |
mamba install --file conda_deps_linux.txt --channel conda-forge --override-channels | |
elif [[ "${{ runner.os }}" == "macOS" ]]; then | |
mamba install --file conda_deps_osx.txt --channel conda-forge --override-channels | |
elif [[ "${{ runner.os }}" == "Windows" ]]; then | |
mamba install --file conda_deps_win.txt --channel conda-forge --override-channels | |
fi | |
- name: Install testing packages | |
run: mamba install -y -c conda-forge flake8 pytest psutil | |
- name: List the conda environment | |
run: conda list | |
- name: Build and install the package | |
run: | | |
if [[ "${{ runner.os }}" == "Windows" ]]; then | |
export LIB="C:/Miniconda/envs/test/Library/lib" | |
pip -vv install . | |
else | |
pip -vv install . | |
fi | |
env: | |
CPU_ONLY: 1 | |
- 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: Run tests | |
run: | | |
if [[ "${{ runner.os }}" == "Windows" ]]; then | |
export PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\HostX86\x64\:$PATH" | |
fi | |
pytest -v -s | |
env: | |
WINDOWS_TESTS: ${{ runner.os == 'Windows' && 'true' || 'false' }} | |
CPU_ONLY: 1 | |
OMP_PREFIX: ${{ runner.os == 'macOS' && '/Users/runner/miniconda3/envs/test' || '' }} | |
- name: Test torchmd-train utility | |
run: torchmd-train --help |