diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..a5f702d --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +'on': + push: + branches: [master, crosspoint-ef] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - 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) + + - name: Build CrossPoint + run: pio run diff --git a/.gitea/workflows/pr-formatting-check.yml b/.gitea/workflows/pr-formatting-check.yml new file mode 100644 index 0000000..eca17a5 --- /dev/null +++ b/.gitea/workflows/pr-formatting-check.yml @@ -0,0 +1,40 @@ +name: "PR Formatting" + +on: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + title-check: + name: Title Check + runs-on: ubuntu-latest + steps: + - name: Check PR Title Format + run: | + PR_TITLE="${{ github.event.pull_request.title }}" + echo "Checking PR title: $PR_TITLE" + + # Conventional commit pattern: type(scope): description or type: description + # Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert + PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-zA-Z0-9_-]+\))?: .+" + + if echo "$PR_TITLE" | grep -qE "$PATTERN"; then + echo "✓ PR title follows conventional commit format" + else + echo "✗ PR title does not follow conventional commit format" + echo "" + echo "Expected format: type(scope): description" + echo " or: type: description" + echo "" + echo "Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert" + echo "" + echo "Examples:" + echo " feat(reader): add bookmark sync feature" + echo " fix: resolve memory leak in epub parser" + echo " docs: update README with new instructions" + exit 1 + fi diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..5511075 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,41 @@ +name: Compile Release +on: + push: + tags: + - '*' + +jobs: + build-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + - name: Build CrossPoint + run: pio run -e gh_release + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: CrossPoint-${{ github.ref_name }} + path: | + .pio/build/gh_release/bootloader.bin + .pio/build/gh_release/firmware.bin + .pio/build/gh_release/firmware.elf + .pio/build/gh_release/firmware.map + .pio/build/gh_release/partitions.bin diff --git a/.gitignore b/.gitignore index c1cf1ed..71d1217 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ build **/__pycache__/ test/epubs/ CrossPoint-ef.md + +# Gitea Actions runner config (contains credentials) +.runner +.runner.*