Compare commits

..

4 Commits

Author SHA1 Message Date
priya-kinthali
1c71e7fbce Update test-tk.yml 2024-12-05 09:33:47 +05:30
priya-kinthali
75c061081b Update test-tk.yml 2024-12-05 09:32:13 +05:30
priya-kinthali
e50bc1c2bf Create tk_min.py 2024-12-05 09:28:59 +05:30
priya-kinthali
4fd1d81fcf Create test-tk.yml 2024-12-05 09:27:59 +05:30
2 changed files with 51 additions and 0 deletions

44
.github/workflows/test-tk.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Test Python Tk
on:
push:
branches:
- tcl-tk
workflow_dispatch:
jobs:
tests-poetry:
strategy:
matrix:
os: [macos-latest-large]
# python-version: ["3.8.10", "3.8.17", "3.9.1", "3.9.19", "3.9.19", "3.10.1", "3.10.14", "3.11.9"]
python-version: [ "3.10.16"]
fail-fast: false
name: ${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# uses: priya-kinthali/setup-python@test-930
uses: priya-kinthali/setup-python@test-tcl
with:
python-version: ${{ matrix.python-version }}
# - name: Print Tcl/Tk version
# run: |
# tclsh <<< 'puts [info patchlevel]; exit'
# wish <<< 'puts [info patchlevel]; exit'
- name: Verify Python Tk Version
run: |
python -c "import tkinter; print(f'Tkinter TkVersion: {tkinter.TkVersion}')"
- name: Prepare Ubuntu xvfb
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libxkbcommon-x11-0 xvfb
- name: Run tk script (closes itself after 5 seconds) - Ubuntu
if: runner.os == 'Linux'
run: xvfb-run python tk_min.py
- name: Run tk script (closes itself after 5 seconds)
if: runner.os != 'Linux'
run: python tk_min.py

7
tk_min.py Normal file
View File

@@ -0,0 +1,7 @@
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Hello World!")
label.pack(padx=20, pady=20)
root.after(5000, root.destroy) # Close the Window after 5 seconds
root.mainloop()