|
21 | 21 | - "setup.cfg" |
22 | 22 | - "**/*.py" |
23 | 23 |
|
| 24 | +concurrency: |
| 25 | + # Cancel previous runs for the same PR |
| 26 | + # Don't cancel successive pushes to master |
| 27 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
24 | 30 | jobs: |
25 | 31 | mypy: |
26 | 32 | runs-on: ${{ matrix.os }} |
| 33 | + timeout-minutes: &timeout-minutes 25 |
27 | 34 | strategy: |
| 35 | + # mypy is os and python-version sensitive. Test on all supported combinations |
28 | 36 | matrix: |
29 | | - os: [windows-latest, ubuntu-latest, macos-latest] |
30 | | - python-version: ["3.10"] |
| 37 | + # Arm runners are faster (as long as the same wheels are available) |
| 38 | + os: [windows-11-arm, ubuntu-24.04-arm, macos-latest] |
| 39 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 40 | + # actions/setup-python doesn't support Python < 3.11 on ARM |
| 41 | + exclude: |
| 42 | + - python-version: "3.9" |
| 43 | + os: windows-11-arm |
| 44 | + - python-version: "3.10" |
| 45 | + os: windows-11-arm |
| 46 | + include: |
| 47 | + - python-version: "3.9" |
| 48 | + os: windows-latest |
| 49 | + - python-version: "3.10" |
| 50 | + os: windows-latest |
31 | 51 | fail-fast: false |
32 | 52 | steps: |
33 | | - - uses: actions/checkout@v4 |
| 53 | + - uses: actions/checkout@v6 |
34 | 54 | - uses: actions/setup-python@v6 |
35 | 55 | with: |
36 | 56 | python-version: ${{ matrix.python-version }} |
| 57 | + cache: "pip" |
37 | 58 | - run: pip install . --group=dev |
38 | 59 | - run: mypy . --python-version=${{ matrix.python-version }} |
39 | 60 |
|
| 61 | + tests: |
| 62 | + runs-on: ${{ matrix.os }} |
| 63 | + timeout-minutes: *timeout-minutes |
| 64 | + strategy: |
| 65 | + # Test on all supported runtime combinations |
| 66 | + matrix: |
| 67 | + # Arm runners are faster (as long as the same wheels are available) |
| 68 | + # PyWinCtl doesn't have any code that should act differently per architecture |
| 69 | + os: [windows-11-arm, ubuntu-24.04-arm, macos-latest] |
| 70 | + # TODO: Run tests in parallel on free-threaded python to catch free-threading issues |
| 71 | + # See: https://py-free-threading.github.io/testing/ |
| 72 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 73 | + # actions/setup-python doesn't support Python < 3.11 on ARM |
| 74 | + exclude: |
| 75 | + - python-version: "3.9" |
| 76 | + os: windows-11-arm |
| 77 | + - python-version: "3.10" |
| 78 | + os: windows-11-arm |
| 79 | + include: |
| 80 | + - python-version: "3.9" |
| 81 | + os: windows-latest |
| 82 | + - python-version: "3.10" |
| 83 | + os: windows-latest |
| 84 | + fail-fast: false |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v6 |
| 87 | + - uses: actions/setup-python@v6 |
| 88 | + with: |
| 89 | + python-version: ${{ matrix.python-version }} |
| 90 | + cache: "pip" |
| 91 | + - run: pip install . --group=dev |
| 92 | + - name: Install Linux Packages |
| 93 | + if: ${{ startsWith(matrix.os, 'ubuntu') }} |
| 94 | + run: | |
| 95 | + sudo apt update |
| 96 | + sudo apt install gedit xvfb x11-xserver-utils openbox dbus-x11 |
| 97 | + - name: Run tests (Linux) |
| 98 | + if: ${{ startsWith(matrix.os, 'ubuntu') }} |
| 99 | + working-directory: tests |
| 100 | + run: xvfb-run --server-args="-screen 0 1280x1024x24" bash -c "openbox & sleep 1 && dbus-launch --exit-with-session python test_pywinctl.py" |
| 101 | + - name: Run tests (Windows & macOS) |
| 102 | + run: python test_pywinctl.py |
| 103 | + if: ${{ !startsWith(matrix.os, 'ubuntu') }} |
| 104 | + working-directory: tests |
| 105 | + |
40 | 106 | sphinx: |
41 | | - runs-on: ubuntu-22.04 # Keep in sync with build.os in .readthedocs.yaml |
| 107 | + runs-on: ubuntu-24.04-arm # Keep in sync with build.os in .readthedocs.yaml |
| 108 | + timeout-minutes: *timeout-minutes |
42 | 109 | steps: |
43 | | - - uses: actions/checkout@v4 |
| 110 | + - uses: actions/checkout@v6 |
44 | 111 | - uses: actions/setup-python@v6 |
45 | 112 | with: |
46 | 113 | python-version: "3.11" # Keep in sync with build.tools.python in .readthedocs.yaml |
47 | 114 | - run: pip install . --group=docs |
48 | 115 | - name: Build docs |
49 | 116 | # TODO: Add --fail-on-warning, but still too many warnings right now |
50 | | - run: sphinx-build --keep-going -b html docs/source docs/_build/html |
| 117 | + run: sphinx-build --keep-going --builder html docs/source docs/_build/html |
0 commit comments