-
-
Notifications
You must be signed in to change notification settings - Fork 90
48 lines (45 loc) · 1.74 KB
/
code-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
name: Code Checks
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: 5yutan5/[email protected]
with:
python-version: '3.11'
poetry-install--only: dev
poetry-install--no-root: 'true'
poetry-virtualenvs-in-project: 'true'
# Hack to make pre-commit/action to use virtual env pre-commit.
# pre-commit/action installs pre-commit using following command:
# `python -m pip install pre-commit`
# But `python` doesn't run virtual env interpreter when PATH is default.
# Override PATH to use virtual env interpreter.
# This change force run the virtual env pre-commit.
- name: Set Poetry virtual env path to PATH
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
pyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: 5yutan5/[email protected]
with:
python-version: '3.11'
poetry-install--only: main,test
poetry-virtualenvs-in-project: 'true'
- run: poetry run pip install PyQt6
# Pyright uses dependencies of the interpreter run with the `python`.
# But `python` doesn't run virtual env interpreter when PATH is default.
# Override PATH to use virtual env interpreter.
# This change makes pyright use dependencies of virtual env interpreter.
- name: Set Poetry virtual env path to PATH
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v1