-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc83215
commit 9d0f816
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Lint & Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'typings' | ||
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 |