From b4667a5c838adb7a4d0a53eeee992e4784231895 Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Thu, 26 Aug 2021 10:44:28 +0800 Subject: =?UTF-8?q?=F0=9F=8D=BB=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/lint.yml (limited to '.github') diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c8eb30f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,83 @@ +name: Lint + +on: + push: + paths: + - "**.py" + - "**.pyi" + - ".github/workflows/lint.yml" + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + name: Lint Code + + steps: + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v2 + + - name: Setup Python 🐍 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - uses: Gr1N/setup-poetry@v4 + + - uses: actions/cache@v2 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} + + - name: Install Dependencies πŸ”§ + env: + POETRY_VIRTUALENVS_CREATE: "false" + run: | + poetry install + python -m pip install --upgrade pip + pip install flake8 + - name: Run Linters + uses: wearerequired/lint-action@v1 + with: + auto_fix: true + black: true + commit_message: ":rotating_light: θ‡ͺεŠ¨θΏ›θ‘Œδ»£η ζ ΌεΌεŒ–" + git_email: noreply@github.com + + analyze: + runs-on: ubuntu-latest + name: CodeQL Analyze + + steps: + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v2 + + - name: Setup Python 🐍 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - uses: Gr1N/setup-poetry@v4 + + - uses: actions/cache@v2 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} + + - name: Install Dependencies πŸ”§ + env: + POETRY_VIRTUALENVS_CREATE: "false" + run: | + poetry install + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: python + # Override the default behavior so that the action doesn't attempt + # to auto-install Python dependencies + setup-python-dependencies: false + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 -- cgit v1.2.3