-
Notifications
You must be signed in to change notification settings - Fork 41
74 lines (63 loc) · 2.38 KB
/
build_cuda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build CUDA
on:
push:
branches: [ master, develop* ]
tags:
- '*'
pull_request:
branches: [ master, develop* ]
jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- uses: actions/checkout@master
with:
submodules: 'recursive'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: startsWith(matrix.os, 'windows')
- name: Add Windows SDK
shell: cmd
if: startsWith(matrix.os, 'windows')
run: |
choco install windows-sdk-8.1
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'
- name: Build CUDA wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: cp38-* cp39-* cp310-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_* *-macosx_*"
CIBW_TEST_REQUIRES: pytest torch numdifftools
CIBW_ENVIRONMENT_LINUX: OSQP_ALGEBRA_BACKEND=cuda CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
CIBW_BEFORE_ALL_LINUX: bash .github/workflows/prepare_build_environment_linux_cuda.sh
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
CIBW_TEST_COMMAND_LINUX: "python -c \"from osqp import algebra_available; assert(algebra_available('cuda'))\""
CIBW_ENVIRONMENT_WINDOWS: OSQP_ALGEBRA_BACKEND=cuda CMAKE_CUDA_COMPILER="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe" CUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6"
CIBW_BEFORE_ALL_WINDOWS: bash .github/workflows/prepare_build_environment_windows_cuda.sh
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
CIBW_TEST_COMMAND_WINDOWS_TODO: "python -c \"from osqp import algebra_available; assert(algebra_available('cuda'))\""
- name: Release to pypi
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
if: ${{ false }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_REPOSITORY: testpypi
run: |
python -m pip install --upgrade twine
twine upload wheelhouse/*
- name: Upload artifacts to github
uses: actions/upload-artifact@v1
with:
name: wheels
path: ./wheelhouse