summaryrefslogtreecommitdiffstats
path: root/.github/workflows/reusable-windows.yml
blob: 459d2b29e5d42ba01cc5d81853c1afed9797253b (plain)
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
name: Reusable Windows

on:
  workflow_call:
    inputs:
      os:
        description: OS to run on
        required: true
        type: string
      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

env:
  IncludeUwp: >-
    true

jobs:
  build:
    name: 'build and test (${{ inputs.arch }})'
    runs-on: ${{ inputs.os }}
    timeout-minutes: 60
    env:
      ARCH: ${{ inputs.arch }}
    steps:
    - uses: actions/checkout@v4
      with:
        persist-credentials: false
    - 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 -v
        -p "${ARCH}"
        ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
      shell: bash
    - name: Display build info  # FIXME(diegorusso): remove the `if`
      if: inputs.arch != 'arm64'
      run: .\\python.bat -m test.pythoninfo
    - name: Tests  # FIXME(diegorusso): remove the `if`
      if: inputs.arch != 'arm64'
      run: >-
        .\\PCbuild\\rt.bat
        -p "${ARCH}"
        -d -q --fast-ci
        ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
      shell: bash