ci: add .deepsource.toml #38
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: Lint & Test | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
merge_group: | |
types: [checks_requested] | |
permissions: | |
read-all | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run pre-commit | |
id: pre-commit | |
uses: pre-commit/[email protected] | |
pyright: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
experimental: [false] | |
fail-fast: false | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
python -m pip install flake8 pytest | |
python -m pip install . | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
flake8 ./easy_pil --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 ./easy_pil --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics | |
- name: Test with pytest | |
run: | | |
pytest | |
- name: Run pyright (Linux) | |
uses: jakebailey/[email protected] | |
id: pyright-linux | |
with: | |
version: ${{ env.PYRIGHT_VERSION }} | |
python-version: ${{ steps.setup-env.outputs.python-version }} | |
python-platform: "Linux" | |
no-comments: ${{ matrix.python-version != '3.8' }} # only add comments for one version | |
warnings: true | |
- name: Run pyright (Windows) | |
uses: jakebailey/[email protected] | |
if: always() && (steps.pyright-linux.outcome == 'success' || steps.pyright-linux.outcome == 'failure') | |
with: | |
version: ${{ env.PYRIGHT_VERSION }} | |
python-version: ${{ steps.setup-env.outputs.python-version }} | |
python-platform: "Windows" | |
no-comments: true # only add comments for one platform (see above) | |
warnings: true |