Update README.md #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linting | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint | |
pip install -r requirements.txt | |
- name: Create reports | |
run: | | |
mkdir -p reports | |
# Pyright | |
- name: Install pyright | |
run: | | |
pip install basedpyright | |
- name: Analyze the code with pyright | |
run: | | |
basedpyright $(git ls-files '*.py') > reports/pyright_report.txt || true | |
basedpyright $(git ls-files '*.py') --outputjson | jq '.summary.errorCount' > pyright_errors.txt | |
# Pylint | |
- name: Install pylint | |
run: | | |
pip install pylint | |
- name: Analyze the code with pylint | |
run: | | |
pylint $(git ls-files '*.py') > reports/pylint_report.txt || true | |
pylint -f json2 $(git ls-files '*.py') | jq '.statistics.score' > pylint_score.txt | |
# Combine | |
- name: Combine results | |
run: | | |
echo "{ \"pyright_errors\": $(cat pyright_errors.txt), \"pylint_score\": $(cat pylint_score.txt) }" > lint.json | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Upload lint.json | |
path: | | |
reports/* | |
- name: Release nightly | |
uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: true | |
name: nightly | |
tag_name: nightly | |
files: | | |
lint.json | |
reports/* | |
fail_on_unmatched_files: true | |
token: ${{ secrets.GITHUB_TOKEN }} |