@@ -10,18 +10,19 @@ permissions:
1010
1111jobs :
1212build :
13- runs-on :ubuntu-latest
14-
1513strategy :
1614fail-fast :false
1715matrix :
16+ os :["ubuntu-latest", "windows-latest"]
1817python-version :["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1918include :
2019 -experimental :false
2120
21+ runs-on :${{ matrix.os }}
22+
2223defaults :
2324run :
24- shell :/bin/ bash --noprofile --norc -exo pipefail {0}
25+ shell :bash --noprofile --norc -exo pipefail {0}
2526
2627steps :
2728 -uses :actions/checkout@v4
3435python-version :${{ matrix.python-version }}
3536allow-prereleases :${{ matrix.experimental }}
3637
38+ -name :Set up WSL (Windows)
39+ if :startsWith(matrix.os, 'windows')
40+ uses :Vampire/setup-wsl@v2.0.2
41+ with :
42+ distribution :Debian
43+
3744 -name :Prepare this repo for tests
3845run :|
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
6983run :|