-
Notifications
You must be signed in to change notification settings - Fork 39
140 lines (121 loc) · 4.17 KB
/
osx-debug.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
name: MacOSX build workflow (debug)
on: [push, pull_request]
env:
BOOST_ROOT: boost
BOOST_VERSION: 1.83.0
STPYV8_DEBUG: 1
jobs:
build-v8:
# Don't build Google V8 if it is already in the workflow cache
# Cloning is necessary in any case to calculate a hash for the
# cache key
name: Build Google V8
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
python-version: ['3.11']
outputs:
v8-hash: ${{ steps.build-v8.outputs.v8-hash }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clone Google V8
run: |
python -m pip install wheel
echo "::group::Clone Google V8"
python setup.py checkout_v8
echo "::endgroup::"
- name: Restore Google V8 from cache
id: restore-v8
uses: actions/cache/restore@main
with:
path: |
v8\out.gn\x64.release.sample\obj\v8_monolith.lib
v8\out.gn\x64.release.sample\icudtl.dat
v8\include
key: ${{ runner.os }}-build-v8-${{ hashFiles('v8/src/**') }}
- name: Build Google V8
id: build-v8
if: ${{ steps.restore-v8.outputs.cache-hit != 'true' }}
continue-on-error: false
run: |
echo "v8-hash=${{ hashFiles('v8/src/**') }}" >> "$GITHUB_OUTPUT"
python -m pip install wheel
echo "::group::v8"
python setup.py v8
echo "::endgroup::"
- name: Save Google V8 to cache
uses: actions/cache/save@main
if: ${{ steps.restore-v8.outputs.cache-hit != 'true' }}
with:
# Save compiled binary and header files
# This will save an additional clone of v8 for the linker
path: |
v8\out.gn\x64.release.sample\obj\v8_monolith.lib
v8\out.gn\x64.release.sample\icudtl.dat
v8\include
key: ${{ runner.os }}-build-v8-${{ hashFiles('v8/src/**') }}
build:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
python-version: ['3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Boost
uses: MarkusJx/install-boost@main
id: install-boost
with:
link: static
boost_version: ${{ env.BOOST_VERSION }}
boost_install_dir: ${{ env.BOOST_ROOT }}
platform_version: 11
- name: Restore Google V8 from cache
id: restore-v8
uses: actions/cache/restore@main
with:
path: |
v8\out.gn\x64.release.sample\obj\v8_monolith.lib
v8\out.gn\x64.release.sample\icudtl.dat
v8\include
key: ${{ runner.os }}-build-v8-${{ needs.build-v8.outputs.v8-hash }}
- name: Build wheel
env:
INCLUDE: ${{steps.install-boost.outputs.BOOST_ROOT}}/include
run: |
python -m pip install wheel pytest
# Google V8 build should be already be supplied from the cache so no need to rebuild
python setup.py sdist bdist_wheel --skip-build-v8 -d ${{ env.DIST_NAME }}
if (-not $?) {
echo "::error::Wheel build failed"
exit 1
}
python setup.py install
if (-not $?) {
echo "::error::Wheel installation failed"
exit 1
}
ls v8\out.gn\x64.release.sample\
cp v8\out.gn\x64.release.sample\icudtl.dat ${{ env.DIST_NAME }}
- name: Test wheel
run: |
pytest -v
- name: Create wheel zip
uses: vimtor/action-zip@v1.1
with:
files: stpyv8-${{ matrix.os }}-${{ matrix.python-version }}-debug/
recursive: false
dest: stpyv8-${{ matrix.os }}-python-${{ matrix.python-version }}-debug.zip
- name: Upload wheel zip
uses: actions/upload-artifact@v3
with:
name: wheels
path: stpyv8-${{ matrix.os }}-python-${{ matrix.python-version }}-debug.zip