Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added linting check and run test on github actions #17

Merged
merged 1 commit into from
Jan 29, 2024
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
71 changes: 71 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Github CI

on:
push:
branches: ['main']
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv

- name: Install dependencies
run: |
pipenv install --dev

- name: Run tests with coverage
run: |
pipenv run coverage-xml

- name: Send coverage to CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true

linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install lint dependencies
run: pip install flake8 mypy isort

- name: flake8
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: flake8
run: flake8 --max-line-length=88 --ignore=E203,W503 src/
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: mypy
run: mypy --strict --show-column-numbers src/
- name: isort
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: isort
run: isort --line-length=88 --check src/
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ pytest-cov = "*"
test = "pytest"
coverage = "pytest --cov=src/ --no-cov-on-fail"
coverage-html = "pytest --cov=src/ --cov-report=html --no-cov-on-fail"
coverage-xml = "pytest --cov=src/ --cov-report=xml --no-cov-on-fail"
install-hooks = "pre-commit install --hook-type pre-commit --hook-type commit-msg"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# commitlint

[![PyPI version](https://badge.fury.io/py/commitlint.svg)](https://badge.fury.io/py/commitlint)
[![CI status](https://github.com/opensource-nepal/commitlint/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/opensource-nepal/commitlint/actions)
[![Downloads](https://img.shields.io/pypi/dm/commitlint.svg?maxAge=180)](https://pypi.org/project/commitlint/)
[![codecov](https://codecov.io/github/opensource-nepal/commitlint/graph/badge.svg?token=lRmPZsIHb6)](https://codecov.io/github/opensource-nepal/commitlint)
[![License](https://img.shields.io/pypi/l/commitlint?label=License)](https://github.com/opensource-nepal/commitlint/blob/main/LICENSE)

commitlint is a tool designed to lint your commit messages according to the [Conventional Commits](https://www.conventionalcommits.org/) standard for your pre-commit hook and GitHub Actions.

## How to use
Expand Down
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This files contains codecov configurations.

# Disabling comments
comment: false

# Disabling Github checks
github_checks: false
coverage:
status:
project: off
patch: off
Loading