ci: run tests once on pull requests

This commit is contained in:
Nathaniel Landau
2023-02-03 13:55:07 -05:00
parent 0de95a4be4
commit b7b77d998c
4 changed files with 21 additions and 13 deletions

View File

@@ -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=(

View File

@@ -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
# ----------------------------------------------

View File

@@ -8,6 +8,8 @@ on:
paths:
- ".devcontainer/**"
- ".github/workflows/devcontainer-checker.yml"
branches:
- main
push:
paths:
- ".devcontainer/**"

View File

@@ -1,4 +1,4 @@
[![PyPI version](https://badge.fury.io/py/obsidian-metadata.svg)](https://badge.fury.io/py/obsidian-metadata) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/obsidian-metadata) [![Python Code Checker](https://github.com/natelandau/obsidian-metadata/actions/workflows/python-code-checker.yml/badge.svg)](https://github.com/natelandau/obsidian-metadata/actions/workflows/python-code-checker.yml) [![codecov](https://codecov.io/gh/natelandau/obsidian-metadata/branch/main/graph/badge.svg?token=3F2R43SSX4)](https://codecov.io/gh/natelandau/obsidian-metadata)
[![PyPI version](https://badge.fury.io/py/obsidian-metadata.svg)](https://badge.fury.io/py/obsidian-metadata) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/obsidian-metadata) [![Python Code Checker](https://github.com/natelandau/obsidian-metadata/actions/workflows/automated-tests.yml/badge.svg)](https://github.com/natelandau/obsidian-metadata/actions/workflows/automated-tests.yml) [![codecov](https://codecov.io/gh/natelandau/obsidian-metadata/branch/main/graph/badge.svg?token=3F2R43SSX4)](https://codecov.io/gh/natelandau/obsidian-metadata)
# obsidian-metadata