-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (68 loc) · 2.73 KB
/
build_wheel.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
name: Build wheel
on: [workflow_dispatch, workflow_call]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: true
matrix:
platform: [windows-latest, ubuntu-latest, macos-13, macos-14]
env:
CIBW_SKIP: 'pp*'
CIBW_ARCHS: 'auto64'
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.9'
CIBW_TEST_REQUIRES: 'pytest'
defaults:
run:
shell: bash -l {0}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python version ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install OMP (MacOS Intel)
if: matrix.platform == 'macos-13'
run: |
brew install llvm libomp
echo "export CC=/usr/local/opt/llvm/bin/clang" >> ~/.bashrc
echo "export CXX=/usr/local/opt/llvm/bin/clang++" >> ~/.bashrc
echo "export CFLAGS=\"$CFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc
echo "export CXXFLAGS=\"$CXXFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp\"" >> ~/.bashrc
source ~/.bashrc
- name: Install OMP (MacOS M1)
if: matrix.platform == 'macos-14'
run: |
brew install llvm libomp
echo "export CC=/opt/homebrew/opt/llvm/bin/clang" >> ~/.bashrc
echo "export CXX=/opt/homebrew/opt/llvm/bin/clang++" >> ~/.bashrc
echo "export CFLAGS=\"$CFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc
echo "export CXXFLAGS=\"$CXXFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp\"" >> ~/.bashrc
source ~/.bashrc
- name: Install OMP (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install libomp-dev
- name: Build Wheel
run: |
# Hack to ensure installed RAT package is used for test instead
# of local package.
mkdir tmp
cp -r tests tmp/tests/
export PATH="$pythonLocation:$PATH"
CIBW_TEST_COMMAND='cd ${pwd}/tmp && python -m pytest tests'
echo "CIBW_TEST_COMMAND=${CIBW_TEST_COMMAND}" >> $GITHUB_ENV
python -m pip install cibuildwheel==2.16.5
python -m cibuildwheel --output-dir ./wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl