Skip to content

Commit

Permalink
MCTK-4: set up CI (#12)
Browse files Browse the repository at this point in the history
* updated Makefile

* set up CI, added pylint dependency

* set up CI, prune scripts in MANIFEST.in
  • Loading branch information
marcusm117 authored Mar 4, 2023
1 parent 409072b commit a621116
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Status

on:
push:
branches:
- main
tags:
- v*
paths-ignore:
- CONTRIBUTING.md
- LICENSE
- README.md
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: 'pyproject.toml'

- name: Install dependencies
run: |
make develop
- name: Build
run: |
make build
- name: Lint
run: |
make lint
- name: Checks
run: |
make checks
- name: Test
run: |
make coverage
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: python_junit.xml
if: ${{ always() }}

- name: Upload coverage
uses: codecov/codecov-action@v3
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ graft mctk

include LICENSE
include README.md

include CONTRIBUTING.md
include .bumpversion.cfg
include pyproject.toml
include Makefile

prune .vscode
prune .github
prune scripts
exclude .gitignore
exclude .gitattributes


# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#########
# BUILD #
#########
develop: ## install dependencies and build library
develop: ## install dependencies and the library
python -m pip install -e .[develop]

build: ## build the python library
Expand All @@ -16,7 +16,7 @@ install: ## install library
#########
lint: ## run static analysis with black, flake8, and pylint
python -m black --check mctk setup.py
python -m flake8 --max-line-length 120 mctk setup.py
python -m flake8 --max-line-length=120 mctk setup.py
python -m pylint --disable=C0301,C0114,C0115,C0116,R1720 mctk setup.py

# Alias
Expand All @@ -25,7 +25,7 @@ lints: lint
format: ## run autoformatting with black
python -m black mctk/ setup.py

# alias
# Alias
fix: format

check: ## check assets for packaging
Expand All @@ -37,18 +37,23 @@ checks: check
annotate: ## run type checking
python -m mypy ./mctk

# Alias
type: annotate


#########
# TESTS #
#########
test: ## clean and run unit tests
python -m pytest -v mctk/tests

# Alias
tests: test

coverage: ## clean and run unit tests with coverage
python -m pytest -v mctk/tests --cov=mctk --cov-branch --cov-fail-under=75 --cov-report term-missing

# Alias
tests: test
cov: coverage


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mctk

![GitHub](https://img.shields.io/badge/License-AGPLv3-green) ![GitHub](https://img.shields.io/github/issues/marcusm117/FV_mctk?color=red&label=Issues)
[![Build Status](https://github.com/marcusm117/mctk/workflows/Build%20Status/badge.svg?branch=dev)](https://github.com/marcusm117/mctk/actions?query=workflow%3A%22Build+Status%22) [![codecov](https://codecov.io/gh/marcusm117/mctk/branch/dev/graph/badge.svg)](https://codecov.io/gh/marcusm117/mctk) ![License](https://img.shields.io/badge/License-AGPLv3-green) ![Issues](https://img.shields.io/github/issues/marcusm117/FV_mctk?color=red&label=Issues)

Model Checking Toolkit in Python.

Expand Down Expand Up @@ -41,14 +41,14 @@ Users can create checker instances to formally verify if a Kripke Structure (can
```
4. Create a New Branch for an Open Issue
```bash
git checkout -b MCTK-[ISSUE NUMBER]
git checkout -b MCTK-[NUMBER]
```
5. Commit your Changes
```bash
git commit -m "meaningful commit message"
```
6. Push to the Branch to your Fork
```bash
git push origin MCTK-[ISSUE NUMBER]
git push origin MCTK-[NUMBER]
```
7. Open a Pull Request against this Repository
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ develop = [
"flake8>=3.7.8",
"flake8-black>=0.2.1",
"flake8-pyproject",
"pylint>=2.16.0",
"mypy",
"pytest>=4.3.0",
"pytest-cov>=2.6.1",
Expand Down

0 comments on commit a621116

Please sign in to comment.