mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 19:35:06 +00:00
104 lines
2.9 KiB
YAML
104 lines
2.9 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [dev, main]
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "overrides/**"
|
|
- "mkdocs.yml"
|
|
- "**.md"
|
|
pull_request:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "overrides/**"
|
|
- "mkdocs.yml"
|
|
- "**.md"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: astral-sh/setup-uv@v8.3.2
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync --locked
|
|
- name: Ruff lint
|
|
run: uv run ruff check .
|
|
- name: Ruff format
|
|
run: uv run ruff format --check .
|
|
- name: Import order
|
|
run: uv run isort --check-only unshackle tests --skip-glob "*/services/*"
|
|
- name: Type check
|
|
if: ${{ !cancelled() }}
|
|
run: |
|
|
out=$(uv run mypy unshackle) || rc=$?
|
|
echo "$out"
|
|
echo "$out" | sed -nE 's/^([^:]+):([0-9]+): error: (.*)$/::error file=\1,line=\2::\3/p'
|
|
exit ${rc:-0}
|
|
- name: Security lint
|
|
if: ${{ !cancelled() }}
|
|
run: uv run bandit -q -c pyproject.toml -r unshackle --severity-level medium --confidence-level medium
|
|
|
|
test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
python-version: ${{ fromJSON(github.event_name == 'push' && github.ref == 'refs/heads/dev' && '["3.11"]' || '["3.11", "3.14"]') }}
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: "3.11"
|
|
coverage: true
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 15
|
|
env:
|
|
UV_NO_SYNC: "1"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: astral-sh/setup-uv@v8.3.2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
enable-cache: true
|
|
- name: Install
|
|
run: uv sync --locked --no-default-groups --group test
|
|
- name: CLI loads
|
|
run: uv run unshackle --help
|
|
- name: Tests
|
|
run: uv run pytest -n auto --dist worksteal -m "not live and not slow" ${{ matrix.coverage && '--cov --cov-report=term --cov-report=html' || '' }}
|
|
- name: Upload coverage report
|
|
if: ${{ matrix.coverage && !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: coverage-report
|
|
path: htmlcov/
|
|
retention-days: 14
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: astral-sh/setup-uv@v8.3.2
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: build
|
|
- name: Build sdist and wheel
|
|
run: uv build
|
|
- name: Smoke-test wheel
|
|
run: uv run --isolated --no-project --with dist/*.whl unshackle --help
|
|
|
|
dependency-review:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/dependency-review-action@v5.0.0
|