-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (74 loc) · 2.39 KB
/
pr_to_master.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
name: Check PR to master
on:
pull_request:
branches:
- master
jobs:
build_wheels:
name: Build wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-14]
steps:
- name: Set MACOSX_DEPLOYMENT_TARGET
run: |
if [[ ${{ matrix.os }} = macos-13 ]]
then
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> "$GITHUB_ENV"
elif [[ ${{ matrix.os }} = macos-14 ]]
then
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> "$GITHUB_ENV"
fi
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build wheels
uses: pypa/[email protected]
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
run_tests:
name: Run tests locally (${{ matrix.os }}, ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
needs: build_wheels
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-14]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Install wheel
run: pip install wheel
- name: Install locally
run: |
if [[ ${{ matrix.os }} = ubuntu-latest ]]
then
pip install "$(echo dist/swisspair*cp"$(tr -d . <<< "${{ matrix.python-version }}")"*manylinux*x86_64*.whl)"[test]
elif [[ ${{ matrix.os }} = macos-13 ]]
then
pip install "$(echo dist/swisspair*cp"$(tr -d . <<< "${{ matrix.python-version }}")"*macosx_13_0*x86_64*.whl)"[test]
elif [[ ${{ matrix.os }} = macos-14 ]]
then
pip install "$(echo dist/swisspair*cp"$(tr -d . <<< "${{ matrix.python-version }}")"*macosx_14_0*arm64.whl)"[test]
fi
- name: Run tests
run: pytest