Base
This commit is contained in:
87
.github/workflows/ci.yml
vendored
Normal file
87
.github/workflows/ci.yml
vendored
Normal file
@@ -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
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -127,3 +127,7 @@ dmypy.json
|
|||||||
|
|
||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
|||||||
@@ -1,2 +1,7 @@
|
|||||||
# template
|
# template
|
||||||
Boilerplate Python project
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
## How to install
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|||||||
8
app/main.py
Normal file
8
app/main.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/local/bin/python3
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Commands here
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
2
codecov.yml
Normal file
2
codecov.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ignore:
|
||||||
|
- "*/tests/*”
|
||||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
3
requirements-dev.txt
Normal file
3
requirements-dev.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
black
|
||||||
|
coverage
|
||||||
|
pytest
|
||||||
0
requirements.txt
Normal file
0
requirements.txt
Normal file
0
tests/test_main.py
Normal file
0
tests/test_main.py
Normal file
Reference in New Issue
Block a user