]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111062 Set up free-threaded CI for windows
authorjuanjose.tenorio <juanjose2611@gmail.com>
Sun, 29 Oct 2023 05:35:37 +0000 (14:35 +0900)
committerDonghee Na <donghee.na@python.org>
Mon, 30 Oct 2023 14:30:20 +0000 (23:30 +0900)
Co-authored-by: Donghee Na <donghee.na@python.org>
.github/workflows/build.yml
.github/workflows/reusable-build-win.yml [new file with mode: 0644]

index 3ef68b62e21a8b2089e1c02d956dd7db8e1acdae..5c6ece07a57ed5b530e98476ca1797e39f4acaae 100644 (file)
@@ -178,56 +178,19 @@ jobs:
         if: github.event_name == 'pull_request'  # $GITHUB_EVENT_NAME
         run: make check-c-globals
 
-  build_win32:
-    name: 'Windows (x86)'
-    runs-on: windows-latest
-    timeout-minutes: 60
+  build_win:
+    name: 'Windows'
     needs: check_source
     if: needs.check_source.outputs.run_tests == 'true'
-    env:
-       IncludeUwp: 'true'
-    steps:
-    - uses: actions/checkout@v4
-    - name: Build CPython
-      run: .\PCbuild\build.bat -e -d -p Win32
-    - name: Display build info
-      run: .\python.bat -m test.pythoninfo
-    - name: Tests
-      run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
-
-  build_win_amd64:
-    name: 'Windows (x64)'
-    runs-on: windows-latest
-    timeout-minutes: 60
-    needs: check_source
-    if: needs.check_source.outputs.run_tests == 'true'
-    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 x64
-    - name: Display build info
-      run: .\python.bat -m test.pythoninfo
-    - name: Tests
-      run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
+    uses: ./.github/workflows/reusable-build-win.yml
 
-  build_win_arm64:
-    name: 'Windows (arm64)'
-    runs-on: windows-latest
-    timeout-minutes: 60
+  build_win_free_threaded:
+    name: 'Windows (free-threaded)'
     needs: check_source
-    if: needs.check_source.outputs.run_tests == 'true'
-    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
+    if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
+    uses: ./.github/workflows/reusable-build-win.yml
+    with:
+      free-threaded: true
 
   build_macos:
     name: 'macOS'
@@ -577,9 +540,7 @@ jobs:
     - check_source  # Transitive dependency, needed to access `run_tests` value
     - check-docs
     - check_generated_files
-    - build_win32
-    - build_win_amd64
-    - build_win_arm64
+    - build_win
     - build_macos
     - build_ubuntu
     - build_ubuntu_ssltests
diff --git a/.github/workflows/reusable-build-win.yml b/.github/workflows/reusable-build-win.yml
new file mode 100644 (file)
index 0000000..d75d9f2
--- /dev/null
@@ -0,0 +1,53 @@
+on:
+  workflow_call:
+    inputs:
+      free-threaded:
+        required: false
+        type: boolean
+        default: false
+
+jobs:
+  build_win_32:
+    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-threaded && '--disable-gil' || '' }}
+    - name: Display build info
+      run: .\python.bat -m test.pythoninfo
+    - name: Tests
+      run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
+
+  build_win_amd64:
+    name: 'build and test (x64)'
+    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 x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
+    - name: Display build info
+      run: .\python.bat -m test.pythoninfo
+    - name: Tests
+      run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
+
+  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-threaded && '--disable-gil' || '' }}