Skip to content

Commit ac9bf43

Browse files
authored
Github Actions CI building (#3901)
- Add .github/workflows/ci.yml - Delete .travis.yml (to disable) - Adjust exit code and query_tests.py setup to reduce crashes on exit
1 parent cc91965 commit ac9bf43

File tree

5 files changed

+38
-77
lines changed

5 files changed

+38
-77
lines changed

.github/workflows/ci.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI Build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ${{ matrix.os }}
6+
strategy:
7+
matrix:
8+
os: [ubuntu-18.04, ubuntu-20.04]
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Install dependencies
13+
# Some projects don't allow in-source building, so create a separate build directory
14+
# We'll use this as our working directory for all subsequent commands
15+
shell: bash
16+
run: |
17+
sudo add-apt-repository ppa:openshot.developers/libopenshot-daily
18+
sudo apt update
19+
sudo apt install libopenshot-audio-dev libopenshot-dev python3-openshot
20+
sudo apt install qttranslations5-l10n libssl-dev xvfb
21+
sudo apt install python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebengine python3-pyqt5.qtopengl python3-zmq python3-xdg
22+
pip3 install setuptools wheel
23+
pip3 install cx_Freeze==6.1 distro defusedxml requests certifi chardet urllib3
24+
25+
- name: Build Python package
26+
# Use a bash shell so we can use the same syntax for environment variable
27+
# access regardless of the host operating system
28+
shell: bash
29+
run: python3 freeze.py build
30+
31+
- name: Test
32+
shell: bash
33+
run: xvfb-run --auto-servernum --server-num=1 --server-args "-screen 0 1920x1080x24" python3 ./src/tests/query_tests.py

.travis.yml

-76
This file was deleted.

src/tests/query_tests.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import random
3535
import unittest
3636
import uuid
37+
from PyQt5.QtGui import QGuiApplication
3738
from classes.app import OpenShotApp
3839
from classes import info
3940
import openshot # Python module for libopenshot (required video editing module installed separately)
@@ -46,7 +47,7 @@ class TestQueryClass(unittest.TestCase):
4647
def setUpClass(TestQueryClass):
4748
""" Init unit test data """
4849
# Create Qt application
49-
TestQueryClass.app = OpenShotApp(sys.argv, mode="unittest")
50+
TestQueryClass.app = OpenShotApp([], mode="unittest")
5051
TestQueryClass.clip_ids = []
5152
TestQueryClass.file_ids = []
5253
TestQueryClass.transition_ids = []
@@ -318,4 +319,5 @@ def test_add_file(self):
318319

319320

320321
if __name__ == '__main__':
322+
app = QGuiApplication(sys.argv)
321323
unittest.main()

src/windows/main_window.py

+1
Original file line numberDiff line numberDiff line change
@@ -2882,6 +2882,7 @@ def __init__(self, *args, mode=None):
28822882
# Connect signals
28832883
if self.mode != "unittest":
28842884
self.RecoverBackup.connect(self.recover_backup)
2885+
app.aboutToQuit.connect(self.close)
28852886

28862887
# Initialize and start the thumbnail HTTP server
28872888
self.http_server_thread = httpThumbnailServerThread()

src/windows/views/webview.py

+1
Original file line numberDiff line numberDiff line change
@@ -3175,6 +3175,7 @@ def __init__(self, window):
31753175
# Connect shutdown signals
31763176
app.aboutToQuit.connect(self.redraw_audio_timer.stop)
31773177
app.aboutToQuit.connect(self.cache_renderer.stop)
3178+
app.aboutToQuit.connect(self.deleteLater)
31783179

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

0 commit comments

Comments
 (0)