Skip to content

Commit

Permalink
Github Actions CI building (#3901)
Browse files Browse the repository at this point in the history
- Add .github/workflows/ci.yml
- Delete .travis.yml (to disable)
- Adjust exit code and query_tests.py setup to
  reduce crashes on exit

timeline_webview: Fix app references
  • Loading branch information
ferdnyc committed Dec 20, 2020
1 parent 253d868 commit 4ab5e13
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 55 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2

- name: Install dependencies
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
shell: bash
run: |
sudo add-apt-repository ppa:openshot.developers/libopenshot-daily
sudo apt update
sudo apt install libopenshot-audio-dev libopenshot-dev python3-openshot
sudo apt install qttranslations5-l10n libssl-dev xvfb
sudo apt install python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebengine python3-pyqt5.qtopengl python3-zmq python3-xdg
pip3 install setuptools wheel
pip3 install cx_Freeze==6.1 distro defusedxml requests certifi chardet urllib3
- name: Build Python package
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
run: python3 freeze.py build

- name: Test
shell: bash
run: xvfb-run --auto-servernum --server-num=1 --server-args "-screen 0 1920x1080x24" python3 ./src/tests/query_tests.py
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion src/tests/query_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import random
import unittest
import uuid
from PyQt5.QtGui import QGuiApplication
from classes.app import OpenShotApp
from classes import info
import openshot # Python module for libopenshot (required video editing module installed separately)
Expand All @@ -46,7 +47,7 @@ class TestQueryClass(unittest.TestCase):
def setUpClass(TestQueryClass):
""" Init unit test data """
# Create Qt application
TestQueryClass.app = OpenShotApp(sys.argv, mode="unittest")
TestQueryClass.app = OpenShotApp([], mode="unittest")
TestQueryClass.clip_ids = []
TestQueryClass.file_ids = []
TestQueryClass.transition_ids = []
Expand Down Expand Up @@ -318,4 +319,5 @@ def test_add_file(self):


if __name__ == '__main__':
app = QGuiApplication(sys.argv)
unittest.main()
1 change: 1 addition & 0 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2509,6 +2509,7 @@ def __init__(self, mode=None):
self.TransformSignal.connect(self.transformTriggered)
if not self.mode == "unittest":
self.RecoverBackup.connect(self.recover_backup)
app.aboutToQuit.connect(self.close)

# Initialize and start the thumbnail HTTP server
self.http_server_thread = httpThumbnailServerThread()
Expand Down
5 changes: 5 additions & 0 deletions src/windows/views/timeline_webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3000,5 +3000,10 @@ def __init__(self, window):
self.cache_renderer.setInterval(0.5 * 1000)
self.cache_renderer.timeout.connect(self.render_cache_json)

# Connect shutdown signals
get_app().aboutToQuit.connect(self.redraw_audio_timer.stop)
get_app().aboutToQuit.connect(self.cache_renderer.stop)
get_app().aboutToQuit.connect(self.deleteLater)

# Delay the start of cache rendering
QTimer.singleShot(1500, self.cache_renderer.start)

0 comments on commit 4ab5e13

Please sign in to comment.