From 665ee4cc24bca29f553447778106bc5a32796572 Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Thu, 20 Nov 2025 10:54:37 -0800 Subject: [PATCH 1/5] (Test) make sure that dev-setup.sh runs bash and is sourced --- .github/workflows/code_quality_checks.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code_quality_checks.yml b/.github/workflows/code_quality_checks.yml index 27211437..c06b1adb 100644 --- a/.github/workflows/code_quality_checks.yml +++ b/.github/workflows/code_quality_checks.yml @@ -13,11 +13,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: setup environment - run: | - ./dev-setup.sh - - name: run pre-commit hooks + - name: setup environment and run pre-commit hooks + shell: bash run: | + source ./dev-setup.sh pre-commit run --all-files --show-diff-on-failure --color=always - name: Print message on failure if: failure() From ab8dd65823e26f999e08a545bb350a19ae756280 Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Thu, 20 Nov 2025 10:58:56 -0800 Subject: [PATCH 2/5] Add workflow_dispatch manual triggering option --- .github/workflows/code_quality_checks.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_quality_checks.yml b/.github/workflows/code_quality_checks.yml index c06b1adb..6bb149ee 100644 --- a/.github/workflows/code_quality_checks.yml +++ b/.github/workflows/code_quality_checks.yml @@ -4,7 +4,9 @@ name: Code Quality Check permissions: contents: read -on: [pull_request] +on: + - pull_request + - workflow_dispatch jobs: pre-commit: From f3474622266e998277a521acd7f0f6dbb54b9ecd Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Thu, 20 Nov 2025 11:26:19 -0800 Subject: [PATCH 3/5] Remove command that fails because venv is not a pip installable package --- dev-setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-setup.sh b/dev-setup.sh index 7cafc606..4ab5ef94 100755 --- a/dev-setup.sh +++ b/dev-setup.sh @@ -1,6 +1,5 @@ # Create venv if not already present if [ ! -d "venv" ]; then - python3 -m pip install venv python3 -m venv venv fi From 6c679afcada9b823d4a01086be4e82db92635d38 Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Thu, 20 Nov 2025 11:55:46 -0800 Subject: [PATCH 4/5] Add shebang for source command safety --- dev-setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-setup.sh b/dev-setup.sh index 4ab5ef94..71b78c3f 100755 --- a/dev-setup.sh +++ b/dev-setup.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Create venv if not already present if [ ! -d "venv" ]; then python3 -m venv venv From ecaf8e6553894cd6e3e3ef7c3bd4478b48dc0a0d Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Thu, 20 Nov 2025 12:33:22 -0800 Subject: [PATCH 5/5] Changed unit-test.yml also to make sure that tests are run in venv --- .github/workflows/unit-test.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9396c24a..7e4d38f6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,19 +17,16 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install package - run: | - ./dev-setup.sh - - name: Install xmllint run: | apt-get update apt-get install -y libxml2-utils bc - - - name: Run unit tests with coverage + - name: Install package and run unit tests with coverage id: extract_coverage + shell: bash run: | + source ./dev-setup.sh pytest test/unit -s --cov=nodescraper --cov-report=xml --cov-report=term --cov-fail-under=70 --maxfail=1 --disable-warnings -v - name: Print coverage