chore: update CI workflows and add labeler configuration

This commit is contained in:
Arthur Tazhitdinov 2026-01-29 03:21:36 +05:00
parent baebb3b2e2
commit 873611b989
3 changed files with 118 additions and 11 deletions

38
.github/labeler.yml vendored Normal file
View File

@ -0,0 +1,38 @@
firmware:
- changed-files:
- any-glob-to-any-file:
- src/**
- lib/**
- open-x4-sdk/**
ui:
- changed-files:
- any-glob-to-any-file:
- src/activities/**
- src/network/html/**
- docs/images/**
epub:
- changed-files:
- any-glob-to-any-file:
- lib/Epub/**
network:
- changed-files:
- any-glob-to-any-file:
- src/network/**
- src/util/UrlUtils.*
- lib/OpdsParser/**
docs:
- changed-files:
- any-glob-to-any-file:
- docs/**
- README*
- CHANGELOG*
tests:
- changed-files:
- any-glob-to-any-file:
- test/**
- scripts/**

View File

@ -9,7 +9,34 @@ permissions:
pull-requests: write
jobs:
build:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install clang-format-21
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get update
sudo apt-get install -y clang-format-21
- name: Run clang-format
run: PATH="/usr/lib/llvm-21/bin:$PATH" ./bin/clang-format-fix && git diff --exit-code || (echo "Please run 'bin/clang-format-fix' to fix formatting issues" && exit 1)
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
@ -23,19 +50,22 @@ jobs:
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Install clang-format-21
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get update
sudo apt-get install -y clang-format-21
- name: Run cppcheck
run: pio check --fail-on-defect low --fail-on-defect medium --fail-on-defect high
- name: Run clang-format
run: PATH="/usr/lib/llvm-21/bin:$PATH" ./bin/clang-format-fix && git diff --exit-code || (echo "Please run 'bin/clang-format-fix' to fix formatting issues" && exit 1)
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build CrossPoint
run: |

View File

@ -9,6 +9,7 @@ on:
permissions:
statuses: write
pull-requests: write
jobs:
title-check:
@ -21,6 +22,44 @@ jobs:
egress-policy: audit
- name: Check PR Title
id: title_check
uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment with changelog hint on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const marker = '<!-- pr-title-check -->';
const error =
`${{ steps.title_check.outputs.error_message || steps.title_check.outputs.error || '' }}`.trim();
const details = error ? `\n\n**Error:** ${error}` : '\n\n**Error:** See workflow logs.';
const body = `${marker}
**PR title check failed**
Please use a Conventional Commit-style prefix (e.g., \`feat:\`, \`fix:\`, \`docs:\`, \`chore:\`).
If this change should appear in release notes, ensure the title reflects the correct category.${details}`;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const existing = comments.find((comment) => comment.body && comment.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}