Skip to content

Commit 8f9fcbb

Browse files
authored
Create wslpython.yml
1 parent 78c1f18 commit 8f9fcbb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/wslpython.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: WSL Python Simple Script Test
2+
3+
on: [push, pull_request]
4+
jobs:
5+
wsl-python-test:
6+
runs-on: windows-2022
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v4
10+
11+
- name: Set up test Python script
12+
run: |
13+
echo "print('Hello from WSL Python!')" > test_script.py
14+
15+
- name: Run simple Python script in WSL
16+
shell: pwsh
17+
run: |
18+
wsl --set-default-version 2
19+
# Ensure Python is installed; most WSL distros have it, or install if missing
20+
wsl python3 --version || wsl sudo apt-get update && wsl sudo apt-get install -y python3
21+
# Run the script
22+
wsl python3 test_script.py
23+
24+
- name: Check for hang and exit
25+
run: echo "WSL Python script finished successfully."

0 commit comments

Comments
 (0)