Skip to content

Commit

Permalink
CI: Static typechecking and error annotations
Browse files Browse the repository at this point in the history
- enable static type checking via pyright-action
- added pyproject.toml with basic meta data and pyright configuration
- use action-shellcheck instead of installing it manually
- use ruff-action instead of installing it manually
- Cache pip dependencies
  • Loading branch information
Root-Core committed Dec 17, 2024
1 parent ad470d5 commit 5c9191e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,40 @@ jobs:
with:
submodules: recursive
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
# The Steam Runtime platform (sniper) uses Python 3.9
python-version: "3.9"
- name: Install dependencies
cache: 'pip' # caching pip dependencies

- name: Install Python dependencies
run: |
sudo apt-get install shellcheck
python3 -m pip install --upgrade pip
pip install ruff
pip install ijson
pip install "git+https://github.com/njbooher/steam.git@wsproto#egg=steam[client]"
- name: Lint with Shellcheck
run: |
shellcheck winetricks
# FIXME: problem matcher is currently disabled upstream, using a fork for the moment
# https://github.com/ludeeus/action-shellcheck/pull/103
- name: Run ShellCheck
uses: Root-Core/action-shellcheck@master
with:
format: gcc # gcc is used for the problem matcher
additional_files: winetricks # by default, only files with according extensions are checked

# Ruff uses ruff.toml for it's configuration
- name: Lint with Ruff
run: |
ruff check .
uses: astral-sh/ruff-action@v1

# Pyright uses pyproject.toml for it's configuration
- name: Static type checking with Pyright
uses: jakebailey/pyright-action@v2

- name: Validate gamefix modules
run: |
python3 .github/scripts/check_gamefixes.py
python3 .github/scripts/check_verbs.py
- name: Test with unittest
run: |
python3 protonfixes_test.py
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[project]
name = "umu-protonfixes"
description = "Stop gap solution to fix issues in games that run under Wine."
keywords = ["proton", "protontricks", "wine", "winetricks", "linux", "gaming"]
license = {file = "LICENSE"}
requires-python = "3.9"


[project.urls]
Repository = "https://github.com/Open-Wine-Components/umu-protonfixes.git"
Issues = "https://github.com/Open-Wine-Components/umu-protonfixes/issues"


[tool.pyright]
exclude = [
"**/__pycache__",
"subprojects",
"verbs"
]
pythonVersion = "3.9"
pythonPlatform = "Linux"

0 comments on commit 5c9191e

Please sign in to comment.