Skip to content

Commit

Permalink
Try out simpler pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
vEnhance committed Jan 20, 2024
1 parent 8a05da2 commit b47db0f
Showing 1 changed file with 7 additions and 47 deletions.
54 changes: 7 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,20 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Copy rc.py
run: |
cp rc.py.EXAMPLE rc.py
# --- dependency installation ---
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv if cache exists
id: cached-poetry-dependencies
uses: actions/cache@v3
- run: pipx install poetry
- uses: actions/setup-python@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies if cache miss
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install root project
run: poetry install --no-interaction

# --- type checking ---
- name: pyright (via ReviewDog)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source .venv/bin/activate
BASE_PATH="$(cd "$(dirname "$0")" && pwd)"
cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit 1
TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
curl -fL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1
echo '::endgroup::'
cache: "poetry"
python-version: "3.10"

echo '::group::🐍🔎 Running pyright with reviewdog 🐶 ...'
curl -fL https://raw.githubusercontent.com/jordemort/action-pyright/a72509b263749732e50c41d335964a100ec9c06a/pyright_to_rdjson/pyright_to_rdjson.py --output pyright_to_rdjson.py
pyright $(git ls-files '*.py') --outputjson |
python3 pyright_to_rdjson.py |
reviewdog -f=rdjson -name="pyright-report" \
-reporter="github-check" \
-fail-on-error="true" -level="warning"
reviewdog_rc=$?
echo '::endgroup::'
exit $reviewdog_rc
- run: poetry install --no-interaction
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH

# actually fail on errors lol
pyright $(git ls-files '*.py')
- uses: jakebailey/pyright-action@v2

style:
name: "Style check"
Expand Down

0 comments on commit b47db0f

Please sign in to comment.