From 8f97f7b5e226937efaa8412a3472855dfa55b648 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Sat, 30 Apr 2022 09:52:16 +0100 Subject: [PATCH] Base --- .github/workflows/ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 4 ++ README.md | 7 +++- app/main.py | 8 ++++ codecov.yml | 2 + renovate.json | 6 +++ requirements-dev.txt | 3 ++ requirements.txt | 0 tests/test_main.py | 0 9 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 app/main.py create mode 100644 codecov.yml create mode 100644 renovate.json create mode 100644 requirements-dev.txt create mode 100644 requirements.txt create mode 100644 tests/test_main.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8ba3e6c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI +on: + push: + paths-ignore: + - 'README.md' + pull_request: + +jobs: + skip_duplicate: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v4.0.0 + with: + github_token: ${{ github.token }} + + # pre-commit: + # needs: skip_duplicate + # if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python 3.10 + # uses: actions/setup-python@v3 + # with: + # python-version: 3.10 + # - uses: pre-commit/action@v2.0.0 + + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + + lint: + needs: skip_duplicate + if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: pip install -r requirements.txt + - name: Lint + run: pylint pwned_pw.py + + test: + needs: skip_duplicate + if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.10' ] + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install -r requirements.txt && pip install -r requirements-dev.txt + - name: Run test suite + run: coverage run -m py.test + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index b6e4761..eb31eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,7 @@ dmypy.json # Pyre type checker .pyre/ + +# IDE +.vscode +.idea diff --git a/README.md b/README.md index b1a0eff..86b71e3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # template -Boilerplate Python project + +## Description + +## How to install + +## How to use diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..a6053f8 --- /dev/null +++ b/app/main.py @@ -0,0 +1,8 @@ +#!/usr/local/bin/python3 + +def main(): + # Commands here + + +if __name__ == "__main__": + main() diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..9fa3a4e --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "*/tests/*” \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..8b6dd1e --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "config:base" + ] + } + \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..89337af --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +black +coverage +pytest \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000..e69de29