Skip to content

Commit

Permalink
Add CI and update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuguangw committed Aug 14, 2023
1 parent 7cba11b commit 2f42614
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
# basic
target: 60%
threshold: 5%
if_ci_failed: error
12 changes: 12 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Pre-Commit

on:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2020 by Jiuguang Wang (www.robo.guru)
# All rights reserved.
# This file is part of DTE Calculator and is released under the MIT License.
# Please see the LICENSE file that should have been included as part of
# this package.

name: Agenoria CI

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: true
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ['3.10']
os: [macOS-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Agenoria
run: |
pip install .[dev]
- name: Pytest
run: |
pytest --cov=./ --cov-report=xml
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
verbose: true
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
<a href="https://www.python.org/">
<img src="https://img.shields.io/badge/built%20with-Python3-red.svg" />
</a>
<a href="https://travis-ci.com/jiuguangw/dte_calculator">
<img src="https://travis-ci.com/jiuguangw/dte_calculator.svg?branch=master">
<a href="https://github.com/jiuguangw/dte_calculator/actions">
<img src="https://github.com/jiuguangw/dte_calculator/actions/workflows/test.yml/badge.svg">
</a>
<a href="https://codeclimate.com/github/jiuguangw/dte_calculator">
<img src="https://img.shields.io/codeclimate/maintainability/jiuguangw/dte_calculator">
<a href="https://codecov.io/gh/jiuguangw/Agenoria">
<img src="https://codecov.io/gh/jiuguangw/Agenoria/branch/main/graph/badge.svg?token=UU0KQ94PAQ" />
</a>
<a href="https://codeclimate.com/github/jiuguangw/dte_calculator/issues">
<img src="https://img.shields.io/codeclimate/issues/jiuguangw/dte_calculator">
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg">
</a>
<a href="https://codeclimate.com/github/jiuguangw/dte_calculator/code">
<img src="https://img.shields.io/codeclimate/coverage/jiuguangw/dte_calculator">
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json">
</a>
<a href="https://github.com/python/mypy">
<img src="http://www.mypy-lang.org/static/mypy_badge.svg">
</a>
</p>
</p>
Expand Down

0 comments on commit 2f42614

Please sign in to comment.