Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 30 additions & 32 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,44 @@ on:
workflow_dispatch:
push:
tags:
- 'v*'
- "v*"
paths-ignore:
- '**.md'
- "**.md"
pull_request:
paths-ignore:
- '**.md'
- "**.md"

jobs:
build_deploy:
name: Build and Deploy Python OrtHW
runs-on: ubuntu-latest
build_deploy:
name: Build and Deploy Python OrtHW
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Setup poetry project
run: |
poetry install -q
poetry build
- uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Check 📦 package
run: |
poetry run twine check dist/*
- name: Build 📦 package
run: |
uv build
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/*

- name: Publish 📦 package
if: github.event_name == 'push'
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: poetry run twine upload -r testpypi dist/*
- name: Publish Test 📦 package
if: github.event_name == 'push'
env:
UV_PUBLISH_USERNAME: ${{ secrets.TEST_PYPI_USER }}
UV_PUBLISH_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
uv publish --index testpypi dist/*
54 changes: 34 additions & 20 deletions .github/workflows/commit_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,47 @@ on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
- "**.md"
push:
branches: [main]

jobs:
build:
name: Validate Commit
runs-on: ubuntu-latest

commitlint:
name: Commit Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: webiny/[email protected]
#- uses: apache/skywalking-eyes/header@main

- name: Install poetry
run: pipx install poetry

mypy:
needs: commitlint
name: MyPy Python linter
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- run:
poetry install -q
- name: MyPy static check
run: |
poetry run mypy --config-file pyproject.toml .
- name: Ruff Linting
run: |
poetry install
poetry run ruff check --config pyproject.toml .
python-version: "3.10"
- name: Install mypy
run: pip install mypy
- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1.3
with:
checkName: "mypy" # NOTE: this needs to be the same as the job name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ruff:
needs: commitlint
name: Ruff Python Linter
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Ruff Check
uses: astral-sh/ruff-action@v3
with:
args: "check --config pyproject.toml"
- name: Ruff Format
uses: astral-sh/ruff-action@v3
with:
args: "format --check --config pyproject.toml"
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -9,7 +9,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -19,21 +19,21 @@ repos:
- types-requests
args: [--config, pyproject.toml]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.4.10"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.9.1"
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/compilerla/conventional-pre-commit
rev: "v3.2.0"
rev: "v4.0.0"
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []

- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
- repo: https://github.com/astral-sh/uv-pre-commit
rev: "0.5.18"
hooks:
- id: poetry-check
- id: uv-lock
Loading