feat: Update github actions

This commit is contained in:
yakhyo
2025-12-23 23:59:15 +09:00
parent 3389aa3e4c
commit 96306a0910
4 changed files with 28 additions and 14 deletions

BIN
.github/logos/gaze_crop.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 KiB

BIN
.github/logos/gaze_org.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

View File

@@ -10,14 +10,20 @@ on:
- main - main
- develop - develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy: strategy:
fail-fast: false fail-fast: false
matrix: 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: steps:
- name: Checkout code - name: Checkout code
@@ -27,7 +33,7 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: 'pip' cache: "pip"
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -38,21 +44,18 @@ jobs:
run: | run: |
python -c "import onnxruntime as ort; print('Available providers:', ort.get_available_providers())" python -c "import onnxruntime as ort; print('Available providers:', ort.get_available_providers())"
- name: Lint with ruff (if available) - name: Lint with ruff
run: | run: ruff check .
pip install ruff || true
ruff check . --exit-zero || true
continue-on-error: true
- name: Run tests - name: Run tests
run: pytest -v --tb=short run: pytest -v --tb=short
- name: Test package imports - name: Test package imports
run: | run: python -c "import uniface; print(f'uniface {uniface.__version__} loaded with {len(uniface.__all__)} exports')"
python -c "from uniface import RetinaFace, ArcFace, Landmark106, AgeGender; print('All imports successful')"
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
needs: test needs: test
steps: steps:
@@ -63,7 +66,7 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.10" python-version: "3.10"
cache: 'pip' cache: "pip"
- name: Install build tools - name: Install build tools
run: | run: |
@@ -84,4 +87,3 @@ jobs:
name: dist-python-${{ github.sha }} name: dist-python-${{ github.sha }}
path: dist/ path: dist/
retention-days: 7 retention-days: 7

View File

@@ -5,9 +5,14 @@ on:
tags: tags:
- "v*.*.*" # Trigger only on version tags like v0.1.9 - "v*.*.*" # Trigger only on version tags like v0.1.9
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
validate: validate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 5
outputs: outputs:
version: ${{ steps.get_version.outputs.version }} version: ${{ steps.get_version.outputs.version }}
tag_version: ${{ steps.get_version.outputs.tag_version }} tag_version: ${{ steps.get_version.outputs.tag_version }}
@@ -16,13 +21,18 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 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 - name: Get version from tag and pyproject.toml
id: get_version id: get_version
run: | run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v} TAG_VERSION=${GITHUB_REF#refs/tags/v}
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT 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 "version=$PYPROJECT_VERSION" >> $GITHUB_OUTPUT
echo "Tag version: v$TAG_VERSION" echo "Tag version: v$TAG_VERSION"
@@ -38,12 +48,13 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15
needs: validate needs: validate
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"] python-version: ["3.10", "3.13"]
steps: steps:
- name: Checkout code - name: Checkout code
@@ -65,6 +76,7 @@ jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
needs: [validate, test] needs: [validate, test]
permissions: permissions:
contents: write contents: write