Merge pull request 'implemented CI template for code quality' (#14) from #13-implement-CI-templates into main
Formatting Check / formatting-check (push) Successful in 39s
Python Code Quality / python-code-quality (push) Successful in 14s
Python Test / python-test (push) Successful in 39s
Sync Label Studio Annotations / sync_storage (push) Successful in 1m5s

Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
Brian Bjarke Jensen
2025-09-19 21:57:27 +02:00
5 changed files with 41 additions and 91 deletions
-44
View File
@@ -1,44 +0,0 @@
name: Code Quality Pipeline
on:
push:
branches:
- main
pull_request:
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync --all-extras
- name: Type check with mypy
run: uv run mypy .
- name: Ruff lint
run: uv run ruff check .
- name: Ruff format
run: uv run ruff format --check .
- name: Pyupgrade check
run: uv run pyupgrade --py312-plus $(git ls-files '*.py') && git diff --exit-code
- name: Prettier format
run: |
npm install --save-dev --save-exact prettier
npx prettier --check .
+11
View File
@@ -0,0 +1,11 @@
name: Formatting Check
on:
push:
branches:
- main
pull_request:
jobs:
formatting-check:
uses: brian/CI-templates/.gitea/workflows/web/[email protected]
+13
View File
@@ -0,0 +1,13 @@
name: Python Code Quality
on:
push:
branches:
- main
pull_request:
jobs:
python-code-quality:
uses: brian/CI-templates/.gitea/workflows/python/[email protected]
with:
python-version: ${{ vars.PYTHON_VERSION }}
+17
View File
@@ -0,0 +1,17 @@
name: Python Test
on:
push:
branches:
- main
pull_request:
jobs:
python-test:
uses: brian/CI-templates/.gitea/workflows/python/[email protected]
with:
python-version: ${{ vars.PYTHON_VERSION }}
coverage-package: "data_store"
api-url: ${{ vars.API_URL }}
secrets:
CI_RUNNER_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }}
-47
View File
@@ -1,47 +0,0 @@
name: Test Python Package
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync --all-extras
- name: Run pytest
env:
PYTHONPATH: .
run: uv run pytest --cov=data_store --cov-report=term-missing > coverage.txt
- name: Post coverage summary to PR
env:
API_URL: ${{ vars.API_URL }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
CI_RUNNER_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }}
run: |
COVERAGE=$(cat coverage.txt)
COMMENT_BODY="**Test Coverage Report:**\n\`\`\`\n$COVERAGE\n\`\`\`"
curl -s -X POST "$API_URL/repos/$REPO_OWNER/$REPO_NAME/issues/$PR_NUMBER/comments" \
-H "Authorization: token $CI_RUNNER_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"body\": \"$COMMENT_BODY\"}"