From ef53bfeedb29227a25e8b5556d0f497afb92d0fe Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Sun, 9 Jun 2024 05:04:10 +1000 Subject: [PATCH] v0.1 --- .github/workflows/actions.yml | 10 ++-------- tests.py | 7 +++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 52280e4..3953a93 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -26,8 +26,6 @@ jobs: - name: Build for Windows run: | pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker Heroes3MapLiker.py - # icacls "dist" /grant:r "Everyone:(OI)(CI)F" /T - ls dist - name: Run Windows Tests run: python tests.py @@ -59,9 +57,8 @@ jobs: - name: Build for macOS run: | pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker_macos Heroes3MapLiker.py - chmod -R +rwx build - ls -l - ls -l build + chmod -R +rwx dist + ls -l dist - name: Run macOS Tests run: python tests.py @@ -95,9 +92,6 @@ jobs: - name: Build for Linux run: | pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --name=Heroes3MapLiker_linux Heroes3MapLiker.py - chmod -R +rwx build - ls -l - ls -l build - name: Run Linux Tests run: python tests.py diff --git a/tests.py b/tests.py index d6bc375..6e7fd2b 100644 --- a/tests.py +++ b/tests.py @@ -22,6 +22,9 @@ class TestGUI(unittest.TestCase): def test_binary_execution(self): """ + + IMPORTANT: pyInstaller builds in /build but deploys binary in /dist + CI/CD workflow triggers on pushing this repo to upstream on Github. Github actions will build binaries for Windows, MacOS, and Linux and run below command which checks for GUI and runs auto close tk window then returns result of pass 0 or fail 0. @@ -34,9 +37,9 @@ def test_binary_execution(self): if sys.platform == 'win32' and not running_headless: # Check if running on Windows binary_path = 'dist/Heroes3MapLiker.exe' elif sys.platform == 'darwin' and not running_headless: # Check if running on macOS - binary_path = 'build/Heroes3MapLiker_macos' + binary_path = 'dist/Heroes3MapLiker_macos' elif sys.platform.startswith('linux') and not running_headless: # Check if running on Linux and not headless - binary_path = 'build/Heroes3MapLiker_linux' + binary_path = 'dist/Heroes3MapLiker_linux' else: self.skipTest("Skipping test cannot find Operating System") return