@@ -10,18 +10,19 @@ permissions:
1010
1111jobs :
1212 build :
13- runs-on : ubuntu-latest
14-
1513 strategy :
1614 fail-fast : false
1715 matrix :
16+ os : ["ubuntu-latest", "windows-latest"]
1817 python-version : ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1918 include :
2019 - experimental : false
2120
21+ runs-on : ${{ matrix.os }}
22+
2223 defaults :
2324 run :
24- shell : /bin/ bash --noprofile --norc -exo pipefail {0}
25+ shell : bash --noprofile --norc -exo pipefail {0}
2526
2627 steps :
2728 - uses : actions/checkout@v4
3435 python-version : ${{ matrix.python-version }}
3536 allow-prereleases : ${{ matrix.experimental }}
3637
38+ - name : Set up WSL (Windows)
39+ if : startsWith(matrix.os, 'windows')
40+ 41+ with :
42+ distribution : Debian
43+
3744 - name : Prepare this repo for tests
3845 run : |
3946 ./init-tests-after-clone.sh
6168 command -v git python
6269 git version
6370 python --version
64- python -c 'import sys; print(sys.platform)'
65- python -c 'import os; print(os.name)'
66- python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly.
71+ python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")'
72+
73+ # For debugging hook tests on native Windows systems that may have WSL.
74+ - name : Show bash.exe candidates (Windows)
75+ if : startsWith(matrix.os, 'windows')
76+ run : |
77+ set +e
78+ bash.exe -c 'printenv WSL_DISTRO_NAME; uname -a'
79+ python -c 'import subprocess; subprocess.run(["bash.exe", "-c", "printenv WSL_DISTRO_NAME; uname -a"])'
80+ continue-on-error : true
6781
6882 - name : Check types with mypy
6983 run : |
0 commit comments