]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111062: Separate macOS build into a reusable workflow (gh-111444)
authorDima Tisnek <dimaqq@gmail.com>
Sun, 29 Oct 2023 06:12:16 +0000 (15:12 +0900)
committerGitHub <noreply@github.com>
Sun, 29 Oct 2023 06:12:16 +0000 (06:12 +0000)
.github/workflows/build.yml
.github/workflows/reusable-build-macos.yml [new file with mode: 0644]

index 3373a0616b66c4539d3635bb4a9d568b0826d3eb..3898687816879391902e68ec91565361fee0ccee 100644 (file)
@@ -231,39 +231,11 @@ jobs:
 
   build_macos:
     name: 'macOS'
-    runs-on: macos-latest
-    timeout-minutes: 60
     needs: check_source
     if: needs.check_source.outputs.run_tests == 'true'
-    env:
-      HOMEBREW_NO_ANALYTICS: 1
-      HOMEBREW_NO_AUTO_UPDATE: 1
-      HOMEBREW_NO_INSTALL_CLEANUP: 1
-      PYTHONSTRICTEXTENSIONBUILD: 1
-    steps:
-    - uses: actions/checkout@v4
-    - name: Restore config.cache
-      uses: actions/cache@v3
-      with:
-        path: config.cache
-        key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
-    - name: Install Homebrew dependencies
-      run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
-    - name: Configure CPython
-      run: |
-        GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
-        GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
-        ./configure \
-          --config-cache \
-          --with-pydebug \
-          --prefix=/opt/python-dev \
-          --with-openssl="$(brew --prefix openssl@3.0)"
-    - name: Build CPython
-      run: make -j4
-    - name: Display build info
-      run: make pythoninfo
-    - name: Tests
-      run: make test
+    uses: ./.github/workflows/reusable-build-macos.yml
+    with:
+      config_hash: ${{ needs.check_source.outputs.config_hash }}
 
   build_ubuntu:
     name: 'Ubuntu'
diff --git a/.github/workflows/reusable-build-macos.yml b/.github/workflows/reusable-build-macos.yml
new file mode 100644 (file)
index 0000000..f4abeaf
--- /dev/null
@@ -0,0 +1,40 @@
+on:
+  workflow_call:
+    inputs:
+      config_hash:
+        required: true
+        type: string
+
+jobs:
+  build_macos:
+    runs-on: macos-latest
+    timeout-minutes: 60
+    env:
+      HOMEBREW_NO_ANALYTICS: 1
+      HOMEBREW_NO_AUTO_UPDATE: 1
+      HOMEBREW_NO_INSTALL_CLEANUP: 1
+      PYTHONSTRICTEXTENSIONBUILD: 1
+    steps:
+    - uses: actions/checkout@v4
+    - name: Restore config.cache
+      uses: actions/cache@v3
+      with:
+        path: config.cache
+        key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
+    - name: Install Homebrew dependencies
+      run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
+    - name: Configure CPython
+      run: |
+        GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
+        GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
+        ./configure \
+          --config-cache \
+          --with-pydebug \
+          --prefix=/opt/python-dev \
+          --with-openssl="$(brew --prefix openssl@3.0)"
+    - name: Build CPython
+      run: make -j4
+    - name: Display build info
+      run: make pythoninfo
+    - name: Tests
+      run: make test