Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install UV
uses: astral-sh/setup-uv@v2
with:
version: "latest"

- name: Install dependencies
run: |
uv sync --dev
- name: Lint with ruff
run: |
uv run ruff check .
uv run ruff format --check .
- name: Type check with mypy
run: |
uv run mypy windows_use --ignore-missing-imports
- name: Security check with bandit
run: |
uv run bandit -r windows_use -f json -o bandit-report.json
continue-on-error: true

- name: Run tests
run: |
uv run pytest tests/ -v --cov=windows_use --cov-report=xml --cov-report=html
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella

- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: |
htmlcov/
bandit-report.json
build:
runs-on: windows-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install UV
uses: astral-sh/setup-uv@v2

- name: Build package
run: |
uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

release:
runs-on: windows-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install UV
uses: astral-sh/setup-uv@v2

- name: Build package
run: |
uv build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv run twine upload dist/*
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pre-commit

on:
pull_request:
push:
branches: [main, develop]

jobs:
pre-commit:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.13"
- uses: pre-commit/action@v3.0.0
101 changes: 90 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,97 @@
# Python-generated files
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[oc]
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info
.ruff_cache
.pytest_cache
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
.venv
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Environments
.env
sandbox
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# IDE and editors
.vscode/
.idea/
*.sublime-project
*.sublime-workspace

# Tool caches
.ruff_cache
.mypy_cache/
.dmypy.json
dmypy.json

# Windows-Use specific
logs/
screenshots/
temp/
cache/
*.tmp
*.temp
.memories

# API keys and secrets
.env.local
.env.production
.env.development
secrets.json
config.json

# Test artifacts
test_screenshots/
test_logs/
test_cache/

# OS generated files
.DS_Store
Thumbs.db
desktop.ini

# Jupyter notebooks
*.ipynb
__pycache__
.vscode
.memories

# Development
sandbox/
local/
dev/
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
- id: check-docstring-first

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies: [types-requests, types-pillow]
args: [--ignore-missing-imports, --no-strict-optional]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest
language: system
pass_filenames: false
always_run: true
args: [tests/unit/, -v, --tb=short]
Loading
Loading