From 965f721caf856c9fae8fd6c1e7c27b8adb5c796f Mon Sep 17 00:00:00 2001 From: scito Date: Sat, 31 Dec 2022 19:20:01 +0100 Subject: [PATCH] ci_docker: run smoke tests before building --- .github/workflows/ci_docker.yml | 9 +++++++++ src/extract_otp_secrets.py | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml index d97d613..fdd8fe7 100644 --- a/.github/workflows/ci_docker.yml +++ b/.github/workflows/ci_docker.yml @@ -22,6 +22,15 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + # avoid building if there are testing errors + - name: Run smoke test + run: | + sudo apt-get install -y libzbar0 + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + pip install . + pytest + - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/src/extract_otp_secrets.py b/src/extract_otp_secrets.py index b9f0818..ea0f331 100644 --- a/src/extract_otp_secrets.py +++ b/src/extract_otp_secrets.py @@ -92,10 +92,10 @@ Exception: {e}""") FONT_LINE_STYLE: Final[int] = cv2.LINE_AA RECT_THICKNESS: Final[int] = 5 # PYTHON <= 3.7: must use () for assignments - START_POS_TEXT: Final[Tuple[Point]] = (5, 20) - NORMAL_COLOR: Final[Tuple[ColorBGR]] = (255, 0, 255) - SUCCESS_COLOR: Final[Tuple[ColorBGR]] = (0, 255, 0) - FAILURE_COLOR: Final[Tuple[ColorBGR]] = (0, 0, 255) + START_POS_TEXT: Final[Point] = (5, 20) + NORMAL_COLOR: Final[ColorBGR] = (255, 0, 255) + SUCCESS_COLOR: Final[ColorBGR] = (0, 255, 0) + FAILURE_COLOR: Final[ColorBGR] = (0, 0, 255) FONT_DY: Final[Tuple[int, int]] = (0, cv2.getTextSize("M", FONT, FONT_SCALE, FONT_THICKNESS)[0][1] + 5) qreader_available = True