Skip to content

ci: update upload

ci: update upload #169

Workflow file for this run

name: Verify that tests pass on all platforms
on: [push]
jobs:
lint_code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
rm -rf 0/
flake8 cyanure_pytorch --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 cyanure_pytorch --count --max-complexity=10 --max-line-length=130 --statistics
build_wheels:
needs: [lint_code]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade setuptools
python -m pip install --upgrade pip
python -m pip install --upgrade virtualenv
python -m pip install setuptools wheel
- name: Build the package
run: python -m pip wheel -w wheelhouse .
env:
TORCH_CUDA_ARCH_LIST: Turing
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*cyanure*.whl
test_imports:
needs: [build_wheels]
name: Smoke test on raw ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Try to import cyanure
run: pip install scipy && pip install 'numpy==1.26.4' && pip install scikit-learn && python -m pip install 'torch<2.3.0' && python -m pip install --no-index --find-links dist cyanure_gpu && python -c "import cyanure_pytorch;"
run_tests:
needs: [build_wheels]
name: Run the tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install cyanure
run: pip install scipy && pip install 'numpy==1.26.4' && pip install scikit-learn && python -m pip install 'torch<2.3.0' && python -m pip install --no-index --find-links dist cyanure_gpu
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- name: Run tests without the lib
uses: knicknic/[email protected]
with:
macos: rm -rf cyanure && rm -rf cyanure_lib && python -m pip install pytest && python -m pip install pandas && python -m pip install libsvmdata && pip list && python -m pytest test/
linux: rm -rf cyanure && rm -rf cyanure_lib && python -m pip install pytest && python -m pip install pandas && python -m pip install libsvmdata && pip list && python -m pytest test/
windows: Remove-Item -Force -Recurse cyanure && Remove-Item -Force -Recurse cyanure_lib && python -m pip install pytest && python -m pip install libsvmdata && python -m pip install pandas && python -m pytest test/