Skip to content

Commit 9071574

Browse files
committed
ci: added linting check and run test on github actions
1 parent cd453e0 commit 9071574

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

.github/workflows/ci.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Github CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ['3.8']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install Pipenv
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install pipenv
28+
29+
- name: Install dependencies
30+
run: |
31+
pipenv install --dev
32+
33+
- name: Run tests with coverage
34+
run: |
35+
pipenv run coverage-xml
36+
37+
- name: Send coverage to CodeCov
38+
uses: codecov/codecov-action@v3
39+
with:
40+
token: ${{ secrets.CODECOV_TOKEN }}
41+
fail_ci_if_error: false
42+
verbose: true
43+
44+
linting:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: '3.8'
53+
54+
- name: Install lint dependencies
55+
run: pip install flake8 mypy isort
56+
57+
- name: flake8
58+
uses: liskin/gh-problem-matcher-wrap@v3
59+
with:
60+
linters: flake8
61+
run: flake8 --max-line-length=88 --ignore=E203,W503 src/
62+
- name: mypy
63+
uses: liskin/gh-problem-matcher-wrap@v3
64+
with:
65+
linters: mypy
66+
run: mypy --strict --show-column-numbers src/
67+
- name: isort
68+
uses: liskin/gh-problem-matcher-wrap@v3
69+
with:
70+
linters: isort
71+
run: isort --line-length=88 --check src/

Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ pytest-cov = "*"
1414
test = "pytest"
1515
coverage = "pytest --cov=src/ --no-cov-on-fail"
1616
coverage-html = "pytest --cov=src/ --cov-report=html --no-cov-on-fail"
17+
coverage-xml = "pytest --cov=src/ --cov-report=xml --no-cov-on-fail"
1718
install-hooks = "pre-commit install --hook-type pre-commit --hook-type commit-msg"

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# commitlint
22

3+
[![PyPI version](https://badge.fury.io/py/commitlint.svg)](https://badge.fury.io/py/commitlint)
4+
[![CI status](https://github.com/opensource-nepal/commitlint/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/opensource-nepal/commitlint/actions)
5+
[![Downloads](https://img.shields.io/pypi/dm/commitlint.svg?maxAge=180)](https://pypi.org/project/commitlint/)
6+
[![codecov](https://codecov.io/github/opensource-nepal/commitlint/graph/badge.svg?token=lRmPZsIHb6)](https://codecov.io/github/opensource-nepal/commitlint)
7+
[![License](https://img.shields.io/pypi/l/commitlint?label=License)](https://github.com/opensource-nepal/commitlint/blob/main/LICENSE)
8+
39
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.
410

511
## How to use

codecov.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This files contains codecov configurations.
2+
3+
# Disabling comments
4+
comment: false
5+
6+
# Disabling Github checks
7+
github_checks: false
8+
coverage:
9+
status:
10+
project: off
11+
patch: off

0 commit comments

Comments
 (0)