diff options
| author | Kyomotoi <Kyomotoiowo@gmail.com> | 2021-08-26 10:40:31 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-26 10:40:31 +0800 | 
| commit | e582203a2d8b52d0434d93c2986a2e467da48448 (patch) | |
| tree | a552ce45c8fe4f0bb0c7164c1748262d35f2a425 /.workflows | |
| parent | 8953d5bd34e2c3724510a414673bf07686ccd6d2 (diff) | |
| download | ATRI-e582203a2d8b52d0434d93c2986a2e467da48448.tar.gz ATRI-e582203a2d8b52d0434d93c2986a2e467da48448.tar.bz2 ATRI-e582203a2d8b52d0434d93c2986a2e467da48448.zip  | |
✨ 再次启用 action
Diffstat (limited to '.workflows')
| -rw-r--r-- | .workflows/lint.yml | 83 | 
1 files changed, 83 insertions, 0 deletions
diff --git a/.workflows/lint.yml b/.workflows/lint.yml new file mode 100644 index 0000000..c8eb30f --- /dev/null +++ b/.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  | 
