|
1 | | -name: CI macOS ARM |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: ["github-actions-ci", "master", "146-macos"] |
6 | | - pull_request: |
7 | | - branches: ["master"] |
8 | | - workflow_dispatch: |
9 | | - inputs: |
10 | | - bypass_cache: |
11 | | - description: "Bypass all caches for a clean run" |
12 | | - type: boolean |
13 | | - default: false |
14 | | - |
15 | | -jobs: |
16 | | - compile: |
17 | | - runs-on: macos-14 |
18 | | - timeout-minutes: 90 |
19 | | - strategy: |
20 | | - fail-fast: false |
21 | | - matrix: |
22 | | - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
23 | | - |
24 | | - steps: |
25 | | - - name: Checkout |
26 | | - uses: actions/checkout@v4 |
27 | | - |
28 | | - - name: Set up Python |
29 | | - uses: actions/setup-python@v5 |
30 | | - with: |
31 | | - python-version: ${{ matrix.python-version }} |
32 | | - |
33 | | - - name: Read CEF version |
34 | | - id: cef-version |
35 | | - run: | |
36 | | - ver=$(python3 -c " |
37 | | - import re, sys |
38 | | - h = open('src/version/cef_version_macarm64.h').read() |
39 | | - m = re.search(r'#define CEF_VERSION \"([^\"]+)\"', h) |
40 | | - print(m.group(1)) |
41 | | - ") |
42 | | - echo "value=$ver" >> $GITHUB_OUTPUT |
43 | | -
|
44 | | - - name: Cache CEF binaries |
45 | | - uses: actions/cache@v4 |
46 | | - if: ${{ inputs.bypass_cache != true }} |
47 | | - with: |
48 | | - path: | |
49 | | - build/cef_binary_* |
50 | | - build/cef*_macarm64 |
51 | | - key: cef-macosarm64-v3-${{ steps.cef-version.outputs.value }} |
52 | | - |
53 | | - - name: Install build tools |
54 | | - run: python tools/requirements.py |
55 | | - |
56 | | - - name: Download CEF binaries |
57 | | - run: python tools/download_cef.py |
58 | | - |
59 | | - - name: Prepare prebuilt CEF |
60 | | - run: python tools/automate.py --prebuilt-cef |
61 | | - |
62 | | - - name: Verify CEF architecture |
63 | | - run: | |
64 | | - wrapper=$(ls build/cef*_macarm64/lib/libcef_dll_wrapper.a 2>/dev/null | head -1) |
65 | | - if [ -z "$wrapper" ]; then echo "libcef_dll_wrapper.a not found"; exit 1; fi |
66 | | - archs=$(lipo -info "$wrapper" 2>&1) |
67 | | - echo "$archs" |
68 | | - echo "$archs" | grep -q arm64 || { echo "ERROR: libcef_dll_wrapper.a is not arm64"; exit 1; } |
69 | | -
|
70 | | - - name: Configure CMake |
71 | | - run: cmake -S . -B build/_cmake_build -G Ninja -DCMAKE_BUILD_TYPE=Release |
72 | | - |
73 | | - - name: Build |
74 | | - run: cmake --build build/_cmake_build --parallel |
75 | | - |
76 | | - - name: Stage build outputs |
77 | | - run: | |
78 | | - mkdir -p build/artifacts |
79 | | - cp build/_cmake_build/cefpython_py*.so build/artifacts/ |
80 | | - cp build/_cmake_build/subprocess_build/subprocess build/artifacts/ |
81 | | - cef_dir=$(ls -d build/cef*_macarm64 2>/dev/null | head -1) |
82 | | - find "$cef_dir/bin" -maxdepth 1 -mindepth 1 \ |
83 | | - ! -name 'cefclient*' ! -name 'cefsimple*' ! -name 'ceftests*' \ |
84 | | - -exec cp -r {} build/artifacts/ \; |
85 | | -
|
86 | | - - name: Upload build artifacts |
87 | | - uses: actions/upload-artifact@v4 |
88 | | - with: |
89 | | - name: build-py${{ matrix.python-version }}-macosarm64 |
90 | | - path: build/artifacts/ |
91 | | - retention-days: 1 |
92 | | - |
93 | | - test: |
94 | | - needs: compile |
95 | | - runs-on: macos-14 |
96 | | - timeout-minutes: 30 |
97 | | - strategy: |
98 | | - fail-fast: false |
99 | | - matrix: |
100 | | - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
101 | | - |
102 | | - steps: |
103 | | - - name: Checkout |
104 | | - uses: actions/checkout@v4 |
105 | | - |
106 | | - - name: Set up Python |
107 | | - uses: actions/setup-python@v5 |
108 | | - with: |
109 | | - python-version: ${{ matrix.python-version }} |
110 | | - |
111 | | - - name: Download build artifacts |
112 | | - uses: actions/download-artifact@v4 |
113 | | - with: |
114 | | - name: build-py${{ matrix.python-version }}-macosarm64 |
115 | | - path: build/artifacts/ |
116 | | - |
117 | | - - name: Set up cefpython3 package for testing |
118 | | - run: | |
119 | | - cp -r build/artifacts/. cefpython3/ |
120 | | - chmod +x cefpython3/subprocess |
121 | | -
|
122 | | - - name: Run unit tests |
123 | | - run: | |
124 | | - python_bin="$(which python)" |
125 | | - sudo launchctl asuser "$(id -u)" \ |
126 | | - /usr/bin/env PYTHONPATH="${{ github.workspace }}" \ |
127 | | - "$python_bin" unittests/_test_runner.py |
128 | | -
|
129 | | - wheel: |
130 | | - needs: test |
131 | | - runs-on: macos-14 |
132 | | - timeout-minutes: 15 |
133 | | - strategy: |
134 | | - fail-fast: false |
135 | | - matrix: |
136 | | - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
137 | | - |
138 | | - steps: |
139 | | - - name: Checkout |
140 | | - uses: actions/checkout@v4 |
141 | | - |
142 | | - - name: Set up Python |
143 | | - uses: actions/setup-python@v5 |
144 | | - with: |
145 | | - python-version: ${{ matrix.python-version }} |
146 | | - |
147 | | - - name: Download build artifacts |
148 | | - uses: actions/download-artifact@v4 |
149 | | - with: |
150 | | - name: build-py${{ matrix.python-version }}-macosarm64 |
151 | | - path: build/artifacts/ |
152 | | - |
153 | | - - name: Set up cefpython3 package |
154 | | - run: cp -r build/artifacts/. cefpython3/ |
155 | | - |
156 | | - - name: Build wheel |
157 | | - run: python tools/build_distrib.py |
158 | | - |
159 | | - - name: Upload wheel artifact |
160 | | - uses: actions/upload-artifact@v4 |
161 | | - with: |
162 | | - name: cefpython3-py${{ matrix.python-version }}-macosarm64 |
163 | | - path: build/dist/*.whl |
| 1 | +name: CI macOS ARM |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["github-actions-ci", "master", "146-macos"] |
| 6 | + pull_request: |
| 7 | + branches: ["master"] |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + bypass_cache: |
| 11 | + description: "Bypass all caches for a clean run" |
| 12 | + type: boolean |
| 13 | + default: false |
| 14 | + |
| 15 | +jobs: |
| 16 | + compile: |
| 17 | + runs-on: macos-14 |
| 18 | + timeout-minutes: 90 |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set up Python |
| 29 | + uses: actions/setup-python@v5 |
| 30 | + with: |
| 31 | + python-version: ${{ matrix.python-version }} |
| 32 | + |
| 33 | + - name: Read CEF version |
| 34 | + id: cef-version |
| 35 | + run: | |
| 36 | + ver=$(python3 -c " |
| 37 | + import re, sys |
| 38 | + h = open('src/version/cef_version_macarm64.h').read() |
| 39 | + m = re.search(r'#define CEF_VERSION \"([^\"]+)\"', h) |
| 40 | + print(m.group(1)) |
| 41 | + ") |
| 42 | + echo "value=$ver" >> $GITHUB_OUTPUT |
| 43 | +
|
| 44 | + - name: Cache CEF binaries |
| 45 | + uses: actions/cache@v4 |
| 46 | + if: ${{ inputs.bypass_cache != true }} |
| 47 | + with: |
| 48 | + path: | |
| 49 | + build/cef_binary_* |
| 50 | + build/cef*_macarm64 |
| 51 | + key: cef-macosarm64-v3-${{ steps.cef-version.outputs.value }} |
| 52 | + |
| 53 | + - name: Install build tools |
| 54 | + run: python tools/requirements.py |
| 55 | + |
| 56 | + - name: Download CEF binaries |
| 57 | + run: python tools/download_cef.py |
| 58 | + |
| 59 | + - name: Prepare prebuilt CEF |
| 60 | + run: python tools/automate.py --prebuilt-cef |
| 61 | + |
| 62 | + - name: Verify CEF architecture |
| 63 | + run: | |
| 64 | + wrapper=$(ls build/cef*_macarm64/lib/libcef_dll_wrapper.a 2>/dev/null | head -1) |
| 65 | + if [ -z "$wrapper" ]; then echo "libcef_dll_wrapper.a not found"; exit 1; fi |
| 66 | + archs=$(lipo -info "$wrapper" 2>&1) |
| 67 | + echo "$archs" |
| 68 | + echo "$archs" | grep -q arm64 || { echo "ERROR: libcef_dll_wrapper.a is not arm64"; exit 1; } |
| 69 | +
|
| 70 | + - name: Configure CMake |
| 71 | + run: cmake -S . -B build/_cmake_build -G Ninja -DCMAKE_BUILD_TYPE=Release |
| 72 | + |
| 73 | + - name: Build |
| 74 | + run: cmake --build build/_cmake_build --parallel |
| 75 | + |
| 76 | + - name: Stage build outputs |
| 77 | + run: | |
| 78 | + mkdir -p build/artifacts |
| 79 | + cp build/_cmake_build/cefpython_py*.so build/artifacts/ |
| 80 | + cp build/_cmake_build/subprocess_build/subprocess build/artifacts/ |
| 81 | + cef_dir=$(ls -d build/cef*_macarm64 2>/dev/null | head -1) |
| 82 | + find "$cef_dir/bin" -maxdepth 1 -mindepth 1 \ |
| 83 | + ! -name 'cefclient*' ! -name 'cefsimple*' ! -name 'ceftests*' \ |
| 84 | + -exec cp -r {} build/artifacts/ \; |
| 85 | +
|
| 86 | + - name: Upload build artifacts |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: build-py${{ matrix.python-version }}-macosarm64 |
| 90 | + path: build/artifacts/ |
| 91 | + retention-days: 1 |
| 92 | + |
| 93 | + test: |
| 94 | + needs: compile |
| 95 | + runs-on: macos-14 |
| 96 | + timeout-minutes: 30 |
| 97 | + strategy: |
| 98 | + fail-fast: false |
| 99 | + matrix: |
| 100 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 101 | + |
| 102 | + steps: |
| 103 | + - name: Checkout |
| 104 | + uses: actions/checkout@v4 |
| 105 | + |
| 106 | + - name: Set up Python |
| 107 | + uses: actions/setup-python@v5 |
| 108 | + with: |
| 109 | + python-version: ${{ matrix.python-version }} |
| 110 | + |
| 111 | + - name: Download build artifacts |
| 112 | + uses: actions/download-artifact@v4 |
| 113 | + with: |
| 114 | + name: build-py${{ matrix.python-version }}-macosarm64 |
| 115 | + path: build/artifacts/ |
| 116 | + |
| 117 | + - name: Set up cefpython3 package for testing |
| 118 | + run: | |
| 119 | + cp -r build/artifacts/. cefpython3/ |
| 120 | + chmod +x cefpython3/subprocess |
| 121 | +
|
| 122 | + - name: Run unit tests |
| 123 | + run: | |
| 124 | + PYTHONPATH="${{ github.workspace }}" python unittests/_test_runner.py |
| 125 | +
|
| 126 | + wheel: |
| 127 | + needs: test |
| 128 | + runs-on: macos-14 |
| 129 | + timeout-minutes: 15 |
| 130 | + strategy: |
| 131 | + fail-fast: false |
| 132 | + matrix: |
| 133 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 134 | + |
| 135 | + steps: |
| 136 | + - name: Checkout |
| 137 | + uses: actions/checkout@v4 |
| 138 | + |
| 139 | + - name: Set up Python |
| 140 | + uses: actions/setup-python@v5 |
| 141 | + with: |
| 142 | + python-version: ${{ matrix.python-version }} |
| 143 | + |
| 144 | + - name: Download build artifacts |
| 145 | + uses: actions/download-artifact@v4 |
| 146 | + with: |
| 147 | + name: build-py${{ matrix.python-version }}-macosarm64 |
| 148 | + path: build/artifacts/ |
| 149 | + |
| 150 | + - name: Set up cefpython3 package |
| 151 | + run: cp -r build/artifacts/. cefpython3/ |
| 152 | + |
| 153 | + - name: Build wheel |
| 154 | + run: python tools/build_distrib.py |
| 155 | + |
| 156 | + - name: Upload wheel artifact |
| 157 | + uses: actions/upload-artifact@v4 |
| 158 | + with: |
| 159 | + name: cefpython3-py${{ matrix.python-version }}-macosarm64 |
| 160 | + path: build/dist/*.whl |
0 commit comments