diff --git a/.github/logos/gaze_crop.png b/.github/logos/gaze_crop.png new file mode 100644 index 0000000..d0098ca Binary files /dev/null and b/.github/logos/gaze_crop.png differ diff --git a/.github/logos/gaze_org.png b/.github/logos/gaze_org.png new file mode 100644 index 0000000..b43a83d Binary files /dev/null and b/.github/logos/gaze_org.png differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e2c620..ad163b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,14 +10,20 @@ on: - main - develop +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + timeout-minutes: 15 strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10", "3.13"] steps: - name: Checkout code @@ -27,7 +33,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' + cache: "pip" - name: Install dependencies run: | @@ -38,21 +44,18 @@ jobs: run: | python -c "import onnxruntime as ort; print('Available providers:', ort.get_available_providers())" - - name: Lint with ruff (if available) - run: | - pip install ruff || true - ruff check . --exit-zero || true - continue-on-error: true + - name: Lint with ruff + run: ruff check . - name: Run tests run: pytest -v --tb=short - name: Test package imports - run: | - python -c "from uniface import RetinaFace, ArcFace, Landmark106, AgeGender; print('All imports successful')" + run: python -c "import uniface; print(f'uniface {uniface.__version__} loaded with {len(uniface.__all__)} exports')" build: runs-on: ubuntu-latest + timeout-minutes: 10 needs: test steps: @@ -63,7 +66,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.10" - cache: 'pip' + cache: "pip" - name: Install build tools run: | @@ -84,4 +87,3 @@ jobs: name: dist-python-${{ github.sha }} path: dist/ retention-days: 7 - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0b4c08f..a21c65a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,14 @@ on: tags: - "v*.*.*" # Trigger only on version tags like v0.1.9 +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: validate: runs-on: ubuntu-latest + timeout-minutes: 5 outputs: version: ${{ steps.get_version.outputs.version }} tag_version: ${{ steps.get_version.outputs.tag_version }} @@ -16,13 +21,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Get version from tag and pyproject.toml id: get_version run: | TAG_VERSION=${GITHUB_REF#refs/tags/v} echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT - PYPROJECT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml) + PYPROJECT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") echo "version=$PYPROJECT_VERSION" >> $GITHUB_OUTPUT echo "Tag version: v$TAG_VERSION" @@ -38,12 +48,13 @@ jobs: test: runs-on: ubuntu-latest + timeout-minutes: 15 needs: validate strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.13"] steps: - name: Checkout code @@ -65,6 +76,7 @@ jobs: publish: runs-on: ubuntu-latest + timeout-minutes: 10 needs: [validate, test] permissions: contents: write