diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..f05d2260 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,py}] +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml new file mode 100644 index 00000000..ae65d203 --- /dev/null +++ b/.github/workflows/ci-pipeline.yml @@ -0,0 +1,53 @@ +name: CI +on: [push] + +jobs: + checkout-code: + runs-on: ubuntu-latest + - uses: actions/checkout@v2 + + check-editorconfig-existance: + runs-on: ubuntu-latest + steps: + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker + + check-python-code: + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.10 + uses: actions/setyp-python@v1 + with: + python-version: 3.10 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r app/requirements.txt + python -m pip install pylint + + - name: Analyze code with PyLint + run: | + find . -name '*.py' -exec pylint {} \; + + - name: Analyze code with Black + uses: psf/black@stable + with: + options: "--check --verbose" + src: "./app" + + - name: Lint with Markdown-lint + uses: articulate/actions-markdownlint@v1 + with: + files: '**/*.md' + ignore: node_modules + version: 0.28.1 + + python-unittest: + runs-on: ubuntu-latest + steps: + - name: Test with unittest + run: | + cd app/ + python -m unittest +