Update workflows #3
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"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint | |
pip install -r requirements.txt | |
# Black | |
- name: Install black | |
run: | | |
pip install black | |
- name: Format the code with black | |
run: | | |
black $(git ls-files '*.py') | |
# Pyright | |
- name: Install pyright | |
run: | | |
pip install basedpyright | |
- name: Analyze the code with pyright | |
run: | | |
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 -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: lint.json | |
- name: Release nightly | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
name: nightly | |
tag_name: nightly | |
files: lint.json | |
fail_on_unmatched_files: true |