forked from onlytailei/CppRobotics
-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (86 loc) · 2.9 KB
/
Copy pathpython-package.yml
File metadata and controls
99 lines (86 loc) · 2.9 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Python package
on:
push:
branches: [master]
paths:
- "python/**"
- "scripts/sync_python_core.sh"
- "src/*_gpu.cu"
- "include/cudarobotics/**"
- "include/cuda_mppi_controller/**"
- "include/cuda_check.cuh"
- ".github/workflows/python-package.yml"
pull_request:
branches: [master]
paths:
- "python/**"
- "scripts/sync_python_core.sh"
- "src/*_gpu.cu"
- "include/cudarobotics/**"
- "include/cuda_mppi_controller/**"
- "include/cuda_check.cuh"
- ".github/workflows/python-package.yml"
jobs:
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.16
with:
cuda: "12.0.0"
method: network
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Sync bundled CUDA core
run: ./scripts/sync_python_core.sh
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip build
python -m build python/ --outdir python/dist
- name: Install from sdist and run tests
run: |
python -m venv /tmp/cudarobotics-test-venv
SDIST=(python/dist/cudarobotics-*.tar.gz)
/tmp/cudarobotics-test-venv/bin/pip install "${SDIST[0]}[test]"
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
/tmp/cudarobotics-test-venv/bin/pytest python/tests -q
- name: Upload wheels
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: cudarobotics-wheels
path: python/dist/*
cibuildwheel:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Sync bundled CUDA core
run: ./scripts/sync_python_core.sh
- name: Build manylinux wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD: cp310-* cp312-*
CIBW_SKIP: pp* *musllinux* *win32 *macosx* *i686*
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: |
set -eux
yum install -y yum-utils
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
yum install -y --setopt=obsoletes=0 cuda-nvcc-12-0 cuda-cudart-devel-12-0 libcurand-devel-12-0
CIBW_ENVIRONMENT: >-
CUDACXX=/usr/local/cuda/bin/nvcc
CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
with:
package-dir: python
- name: Upload manylinux wheels
uses: actions/upload-artifact@v4
with:
name: cudarobotics-manylinux-wheels
path: wheelhouse/*