Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 21 additions & 28 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,26 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- name: Set up uv and Python
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
with:
version: "0.8.17"
checksum: "920cbcaad514cc185634f6f0dcd71df5e8f4ee4456d440a22e0f8c0f142a8203"
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install dependencies
run: |
pip install uv
export UV_LINK_MODE=copy && \
uv sync --group dev && \
uv run ruff check --select I --fix . && \
uv run ruff format . && \
uv build
uv sync
uv pip install "urllib3==${{ matrix.urllib3-version }}"

- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
name: Run `ruff`
run: uv run ruff check

- name: Run tests and collect coverage
run: |
export UV_LINK_MODE=copy && \
uv sync --group dev && \
uv run --with "urllib3==${{ matrix.urllib3-version }}" \
pytest --cov-report term-missing --cov=openfga_sdk --cov-fail-under=60 test/ && \
uv run ruff check .
run: uv run pytest --cov-fail-under 60 --cov openfga_sdk

- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
name: Upload coverage to Codecov
Expand All @@ -74,23 +70,20 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- name: Set up uv and Python
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
with:
version: "0.8.17"
checksum: "920cbcaad514cc185634f6f0dcd71df5e8f4ee4456d440a22e0f8c0f142a8203"
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
**/test-requirements*.txt
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install dependencies
run: pip install -r test-requirements.txt --upgrade pip
run: uv sync

- name: Build package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
Expand Down