mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
733d138fcc
- Added new exceptions in `exceptions.py` for unsupported browsers and cookie read failures. - Introduced `get_cookies_from_browser` function in `cookies.py` to extract session cookies from various browsers. - Modified tests to cover new cookie extraction functionality, including success and failure cases. - Refactored existing tests to use `patch.object` for mocking client calls. - Updated dependencies in `pyproject.toml` to include `rookiepy` for cookie extraction.
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
branches: ["**"]
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint & Format
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- uses: actions/setup-python@v6.2.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
|
|
- run: uv pip install --system ".[dev]"
|
|
|
|
- run: ruff check . && black --check . --target-version py312 && mypy pyfragment
|
|
|
|
test:
|
|
name: Tests (Python ${{ matrix.python-version }})
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
COOKIES_JSON: ${{ secrets.COOKIES_JSON }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.12", "3.13", "3.14"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Set up conda (Miniconda)
|
|
uses: conda-incubator/setup-miniconda@v3
|
|
with:
|
|
auto-update-conda: true
|
|
python-version: ${{ matrix.python-version }}
|
|
activate-environment: pyfragment-test
|
|
auto-activate-base: false
|
|
|
|
- name: Install package and dev dependencies
|
|
shell: bash -el {0}
|
|
run: pip install ".[dev]"
|
|
|
|
- name: Run tests
|
|
shell: bash -el {0}
|
|
run: pytest
|