fix linting issues
This commit is contained in:
parent
527947767e
commit
213315cf93
58
.github/workflows/ci.yml
vendored
58
.github/workflows/ci.yml
vendored
@ -1,20 +1,48 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_call:
|
||||||
branches: [ main ]
|
secrets:
|
||||||
pull_request:
|
SONAR_TOKEN:
|
||||||
types: [opened, synchronize, reopened]
|
required: true
|
||||||
paths-ignore:
|
SNYK_TOKEN:
|
||||||
- 'README.md'
|
required: true
|
||||||
- 'LICENSE.md'
|
|
||||||
- '.gitignore'
|
|
||||||
- 'CODEOWNERS'
|
|
||||||
- 'renovate.json'
|
|
||||||
- '.github/'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
uses: luketainton/gha-workflows/.github/workflows/ci-python-poetry.yml@main
|
runs-on: ubuntu-latest
|
||||||
secrets:
|
steps:
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
- name: Check out repository code
|
||||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
uses: actions/checkout@v4.1.4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
- name: Setup Poetry
|
||||||
|
uses: abatilo/actions-poetry@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: poetry install
|
||||||
|
- name: Lint
|
||||||
|
run: poetry run ./tools/lint.sh
|
||||||
|
- name: Unit Test
|
||||||
|
run: |
|
||||||
|
poetry run coverage run -m pytest -v --junitxml=testresults.xml
|
||||||
|
poetry run coverage xml
|
||||||
|
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: SonarSource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
- name: Snyk Vulnerability Scan
|
||||||
|
uses: snyk/actions/python-3.10@master
|
||||||
|
continue-on-error: true # To make sure that SARIF upload gets called
|
||||||
|
env:
|
||||||
|
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||||
|
with:
|
||||||
|
args: --sarif-file-output=snyk.sarif
|
||||||
|
- name: Upload result to GitHub Code Scanning
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: snyk.sarif
|
||||||
|
3
tools/lint.sh
Executable file
3
tools/lint.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
|
Loading…
x
Reference in New Issue
Block a user