-
Notifications
You must be signed in to change notification settings - Fork 10
144 lines (140 loc) · 4.7 KB
/
python_package.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Python Package
on: [push,workflow_dispatch]
jobs:
build:
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
os: ['ubuntu-20.04', 'macos-latest', 'windows-latest', 'linux-arm64', 'macos-arm64']
experimental: [false]
# exclude:
# excludes python-version 3.7 on macOS-arm64 (Not available via brew)
# - os: macos-arm64
# python-version: 3.7
steps:
- uses: actions/checkout@v2
- name: Customize git
run: |
git submodule update --init --recursive
git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }} (Github Hosted VMs)
if: matrix.os != 'linux-arm64' && matrix.os != 'macos-arm64'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }} (Self Hosted Vms)
if: matrix.os == 'linux-arm64' || matrix.os == 'macos-arm64'
run: |
python${{ matrix.python-version }} -m venv venv${{ matrix.python-version }}
echo "${{github.workspace}}/venv${{matrix.python-version}}/bin/" >> $GITHUB_PATH
sed -i'' -e 's/-j2/-j8/g' setup.py
- name: Install compilation dependencies [Ubuntu/C++]
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt install libeigen3-dev
- name: Install compilation dependencies [MacOS/C++]
if: matrix.os == 'macos-latest'
run: |
brew install eigen
- name: Install compilation dependencies [Windows/C++]
if: matrix.os == 'windows-latest'
run: |
pwd
echo "Setting up vcpkg..."
cd C:\vcpkg
.\bootstrap-vcpkg.bat
vcpkg integrate install
echo "Installing eigen3..."
.\vcpkg install eigen3:x64-windows
echo "Adding symlink to vcpkg..."
cmd /c mklink /d c:\Tools\vcpkg c:\vcpkg
cd ~
- name: Install compilation dependencies [Python]
run: |
python -m pip install --upgrade pip
pip install setuptools wheel setuptools-git
- name: Compile
run: |
python setup.py bdist_wheel
- name: Remove build folder for (not Windows)
if: matrix.os != 'windows-latest'
run: |
rm -rf build
- name: Remove build folder (Windows only)
if: matrix.os == 'windows-latest'
run: |
rm -r -fo build
- name: Rename wheel (MacOS only)
if: matrix.os == 'macos-latest'
run: |
brew install rename
cd dist
sw_vers
rename 's/11_0/10_14/' *
rename 's/12_0/10_15/' *
cd ..
- name: Install (not Windows)
if: matrix.os != 'windows-latest'
run: |
python tests/print_platform_info.py
python -m pip install dist/*.whl
- name: Install (Windows)
if: matrix.os == 'windows-latest'
run: |
python tests/print_platform_info.py
python -m pip install @(join-path "dist" (get-childitem -path dist -name *.whl))
- name: Remove old quadprog folder (self-hosted)
if: matrix.os == 'linux-arm64' || matrix.os == 'macos-arm64'
run: |
cd tests
python -m pip uninstall quadprog -y
rm -rf quadprog
cd ..
- name: Install Test Pre-requisites (quadprog always manual)
run: |
cd tests
python -m pip install scipy
git clone https://github.com/quadprog/quadprog.git
cd quadprog
pip install -r requirements_develop.txt && python -m cython quadprog/quadprog.pyx
cd ..
python -m pip install ./quadprog
cd ..
- name: Test
run: |
cd tests
python DQ_test.py
python DQ_Kinematics_test.py
python DQ_SerialManipulatorMDH_test.py
python cpp_issues.py
python python_issues.py
python DQ_Kinematics_pose_jacobian_derivative_tests.py
python DQ_Kinematics_static_jacobian_derivative_tests.py
cd ..
- name: Rename wheel (Ubuntu Only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt install rename
cd dist
rename 's/linux/manylinux1/' *
cd ..
- name: Rename wheel (Self Hosted [linux-arm64] Only)
if: matrix.os == 'linux-arm64'
run: |
cd dist
rename 's/linux/manylinux2014/' *
cd ..
- name: Publish to PyPi
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
if: github.ref == 'refs/heads/master'
run: |
python -m pip install twine
twine upload dist/*