Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/code_quality_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name: Code Quality Check
permissions:
contents: read

on: [pull_request]
on:
- pull_request
- workflow_dispatch

jobs:
pre-commit:
Expand All @@ -13,11 +15,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()
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion dev-setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

# Create venv if not already present
if [ ! -d "venv" ]; then
python3 -m pip install venv
python3 -m venv venv
fi

Expand Down