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