]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Generalize reusable Windows CI jobs (#121766) (#121776)
authorSviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Mon, 22 Jul 2024 11:40:10 +0000 (13:40 +0200)
committerGitHub <noreply@github.com>
Mon, 22 Jul 2024 11:40:10 +0000 (05:40 -0600)
.github/workflows/build.yml
.github/workflows/reusable-windows.yml

index a3f8ed1e2fe56cef29d9ff0e9ea6764e86ccfc5d..e043dc4da1a78ffe4b3c242581a8733f2474d438 100644 (file)
@@ -236,10 +236,24 @@ jobs:
         run: make check-c-globals
 
   build_windows:
-    name: 'Windows'
+    name: >-
+      Windows
+      ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
     needs: check_source
-    if: needs.check_source.outputs.run_tests == 'true'
+    if: fromJSON(needs.check_source.outputs.run_tests)
+    strategy:
+      matrix:
+        arch:
+        - Win32
+        - x64
+        - arm64
+        free-threading:
+        - false
+        # - true
     uses: ./.github/workflows/reusable-windows.yml
+    with:
+      arch: ${{ matrix.arch }}
+      free-threading: ${{ matrix.free-threading }}
 
   build_macos:
     name: 'macOS'
index de30c980e22f860b733a1802ad3fe36c22827ee2..8b886056fe56b8e7523a0cfc1d25e3a318b3e66d 100644 (file)
@@ -1,54 +1,45 @@
 on:
   workflow_call:
     inputs:
+      arch:
+        description: CPU architecture
+        required: true
+        type: string
       free-threading:
         description: Whether to compile CPython in free-threading mode
         required: false
         type: boolean
         default: false
 
-jobs:
-  build_win32:
-    name: 'build and test (x86)'
-    runs-on: windows-latest
-    timeout-minutes: 60
-    env:
-      IncludeUwp: 'true'
-    steps:
-    - uses: actions/checkout@v4
-    - name: Build CPython
-      run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
-    - name: Display build info
-      run: .\python.bat -m test.pythoninfo
-    - name: Tests
-      run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
+env:
+  IncludeUwp: >-
+    true
 
-  build_win_amd64:
-    name: 'build and test (x64)'
+jobs:
+  build:
+    name: >-
+      build${{ inputs.arch != 'arm64' && ' and test' || '' }}
+      (${{ inputs.arch }})
     runs-on: windows-latest
     timeout-minutes: 60
-    env:
-       IncludeUwp: 'true'
     steps:
     - uses: actions/checkout@v4
     - name: Register MSVC problem matcher
+      if: inputs.arch != 'Win32'
       run: echo "::add-matcher::.github/problem-matchers/msvc.json"
     - name: Build CPython
-      run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
+      run: >-
+        .\PCbuild\build.bat
+        -e -d
+        -p ${{ inputs.arch }}
+        ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
     - name: Display build info
+      if: inputs.arch != 'arm64'
       run: .\python.bat -m test.pythoninfo
     - name: Tests
-      run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
-
-  build_win_arm64:
-    name: 'build (arm64)'
-    runs-on: windows-latest
-    timeout-minutes: 60
-    env:
-      IncludeUwp: 'true'
-    steps:
-    - uses: actions/checkout@v4
-    - name: Register MSVC problem matcher
-      run: echo "::add-matcher::.github/problem-matchers/msvc.json"
-    - name: Build CPython
-      run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}
+      if: inputs.arch != 'arm64'
+      run: >-
+        .\PCbuild\rt.bat
+        -p ${{ inputs.arch }}
+        -d -q -uall -u-cpu -rwW
+        --slowest --timeout=1200 -j0