mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-08 05:03:47 -05:00
ci: run tests once on pull requests
This commit is contained in:
@@ -54,7 +54,7 @@ _mainScript_() {
|
||||
echo ""
|
||||
header "Installing shfmt"
|
||||
if ! command -v shfmt &>/dev/null; then
|
||||
_execute_ "curl -sS https://webi.sh/shfmt | sh"
|
||||
_execute_ -pv "curl -sS https://webi.sh/shfmt | sh"
|
||||
fi
|
||||
|
||||
REPOS=(
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
---
|
||||
name: "Python Code Checker"
|
||||
name: "Automated Tests"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/python-code-checker.yml"
|
||||
- ".github/workflows/automated-tests.yml"
|
||||
- ".github/actions/**"
|
||||
- "src/**"
|
||||
- "tests/**"
|
||||
- "pyproject.toml"
|
||||
- "poetry.lock"
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, reopened]
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
paths:
|
||||
- ".github/workflows/python-code-checker.yml"
|
||||
- ".github/workflows/automated-tests.yml"
|
||||
- ".github/actions/**"
|
||||
- "src/**"
|
||||
- "tests/**"
|
||||
@@ -62,15 +67,9 @@ jobs:
|
||||
- name: Lint with Mypy
|
||||
run: poetry run mypy src/
|
||||
- name: lint with ruff
|
||||
run: poetry run ruff --extend-ignore=I001,D301 src/
|
||||
run: poetry run ruff --extend-ignore=I001,D301,D401,PLR2004,PLR0913 src/
|
||||
- name: check pyproject.toml
|
||||
run: poetry run poetry check
|
||||
- name: lint with black
|
||||
run: poetry run black --check src/
|
||||
- name: run vulture
|
||||
run: poetry run vulture src/
|
||||
- name: run interrogate
|
||||
run: poetry run interrogate -c pyproject.toml .
|
||||
|
||||
# ----------------------------------------------
|
||||
# run test suite
|
||||
@@ -80,6 +79,13 @@ jobs:
|
||||
poetry run coverage run
|
||||
poetry run coverage report
|
||||
poetry run coverage xml
|
||||
|
||||
# ----------------------------------------------
|
||||
# confirm package builds
|
||||
# ----------------------------------------------
|
||||
- name: Build package
|
||||
run: poetry build
|
||||
|
||||
# ----------------------------------------------
|
||||
# upload coverage stats
|
||||
# ----------------------------------------------
|
||||
2
.github/workflows/devcontainer-checker.yml
vendored
2
.github/workflows/devcontainer-checker.yml
vendored
@@ -8,6 +8,8 @@ on:
|
||||
paths:
|
||||
- ".devcontainer/**"
|
||||
- ".github/workflows/devcontainer-checker.yml"
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
paths:
|
||||
- ".devcontainer/**"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[](https://badge.fury.io/py/obsidian-metadata)  [](https://github.com/natelandau/obsidian-metadata/actions/workflows/python-code-checker.yml) [](https://codecov.io/gh/natelandau/obsidian-metadata)
|
||||
[](https://badge.fury.io/py/obsidian-metadata)  [](https://github.com/natelandau/obsidian-metadata/actions/workflows/automated-tests.yml) [](https://codecov.io/gh/natelandau/obsidian-metadata)
|
||||
|
||||
# obsidian-metadata
|
||||
|
||||
|
||||
Reference in New Issue
Block a user