|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + python-version: ['3.12', '3.13'] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install uv |
| 26 | + uses: astral-sh/setup-uv@v4 |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: uv sync --all-extras |
| 30 | + |
| 31 | + - name: Run tests with coverage |
| 32 | + run: uv run pytest tests/ -v --cov=parallel_web_tools --cov-report=xml --cov-report=term |
| 33 | + |
| 34 | + - name: Upload coverage to Codecov |
| 35 | + if: matrix.python-version == '3.12' |
| 36 | + uses: codecov/codecov-action@v4 |
| 37 | + with: |
| 38 | + file: ./coverage.xml |
| 39 | + fail_ci_if_error: false |
| 40 | + continue-on-error: true |
| 41 | + |
| 42 | + lint: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Checkout code |
| 47 | + uses: actions/checkout@v4 |
| 48 | + |
| 49 | + - name: Set up Python |
| 50 | + uses: actions/setup-python@v5 |
| 51 | + with: |
| 52 | + python-version: '3.12' |
| 53 | + |
| 54 | + - name: Install uv |
| 55 | + uses: astral-sh/setup-uv@v4 |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: uv sync --all-extras |
| 59 | + |
| 60 | + - name: Lint with ruff |
| 61 | + run: uv run ruff check parallel_web_tools/ tests/ |
| 62 | + |
| 63 | + - name: Check formatting with ruff |
| 64 | + run: uv run ruff format --check parallel_web_tools/ tests/ |
| 65 | + |
| 66 | + - name: Type check with pyrefly |
| 67 | + run: uv run pyrefly check parallel_web_tools/ |
| 68 | + continue-on-error: true |
| 69 | + |
| 70 | + cli-test: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + |
| 73 | + steps: |
| 74 | + - name: Checkout code |
| 75 | + uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Set up Python |
| 78 | + uses: actions/setup-python@v5 |
| 79 | + with: |
| 80 | + python-version: '3.12' |
| 81 | + |
| 82 | + - name: Install uv |
| 83 | + uses: astral-sh/setup-uv@v4 |
| 84 | + |
| 85 | + - name: Install package with CLI |
| 86 | + run: uv sync --all-extras |
| 87 | + |
| 88 | + - name: Test CLI help commands |
| 89 | + run: | |
| 90 | + uv run parallel-cli --help |
| 91 | + uv run parallel-cli auth --help |
| 92 | + uv run parallel-cli search --help |
| 93 | + uv run parallel-cli extract --help |
| 94 | + uv run parallel-cli enrich --help |
| 95 | + uv run parallel-cli enrich run --help |
| 96 | + uv run parallel-cli enrich plan --help |
| 97 | + uv run parallel-cli enrich suggest --help |
| 98 | + uv run parallel-cli enrich deploy --help |
| 99 | +
|
| 100 | + - name: Test CLI version |
| 101 | + run: uv run parallel-cli --version |
| 102 | + |
| 103 | + - name: Test Python imports |
| 104 | + run: | |
| 105 | + uv run python -c "from parallel_web_tools import run_enrichment, get_api_key, enrich_batch" |
| 106 | + uv run python -c "from parallel_web_tools.core import auth, schema, batch" |
| 107 | + uv run python -c "from parallel_web_tools.cli import main" |
| 108 | + uv run python -c "from parallel_web_tools.integrations.polars import parallel_enrich" |
| 109 | + uv run python -c "from parallel_web_tools.integrations.duckdb import enrich_table" |
0 commit comments