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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
directory: "/"
schedule:
interval: weekly
target-branch: "release"
target-branch: "develop"
open-pull-requests-limit: 5
groups:
minor-and-patch:
Expand All @@ -20,7 +20,7 @@ updates:
directory: "/"
schedule:
interval: weekly
target-branch: "release"
target-branch: "develop"
open-pull-requests-limit: 5
groups:
minor-and-patch:
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Kotlin CI

on:
push:
branches: [release, develop]
paths:
- 'packages/core/android/**'
- '.github/workflows/android.yml'
pull_request:
branches: [release, develop]
paths:
- 'packages/core/android/**'
- '.github/workflows/android.yml'
workflow_dispatch:

permissions:
contents: read
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
kotlin:
name: Kotlin (lint+build+test+docs)
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip android]') }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
build-root-directory: packages/core/android

- name: Make gradlew executable
run: chmod +x packages/core/android/gradlew

- name: Clean build
working-directory: packages/core/android
run: ./gradlew clean --stacktrace --no-daemon

- name: Lint (ktlint)
working-directory: packages/core/android
run: ./gradlew ktlintCheck --stacktrace --no-daemon || echo "ktlint not configured"

- name: Static analysis (detekt)
working-directory: packages/core/android
run: ./gradlew detekt --stacktrace --no-daemon || echo "detekt not configured"

- name: Build JAR
working-directory: packages/core/android
run: ./gradlew assemble --stacktrace --no-daemon

- name: Run unit tests
working-directory: packages/core/android
run: ./gradlew test --stacktrace --no-daemon

- name: Generate docs (Dokka)
working-directory: packages/core/android
run: ./gradlew dokkaHtml --stacktrace --no-daemon || echo "Dokka not configured"

- name: Copy Dokka to docs/api/android
run: |
if [ -d "packages/core/android/build/dokka/html" ]; then
mkdir -p docs/api/android
cp -R packages/core/android/build/dokka/html/. docs/api/android/
echo "Dokka docs copied to docs/api/android"
else
echo "No Dokka HTML output found"
fi

- name: Upload test reports
uses: actions/upload-artifact@v4
if: always()
with:
name: android-test-reports-${{ github.run_id }}
path: packages/core/android/build/reports/
if-no-files-found: ignore
retention-days: 7

- name: Upload lint reports
uses: actions/upload-artifact@v4
if: always()
with:
name: android-lint-reports-${{ github.run_id }}
path: |
packages/core/android/build/reports/ktlint/
packages/core/android/build/reports/detekt/
if-no-files-found: ignore
retention-days: 7

- name: Upload JAR
uses: actions/upload-artifact@v4
with:
name: kotlin-jar-${{ github.run_id }}
path: packages/core/android/build/libs/*.jar
if-no-files-found: ignore
retention-days: 7

- name: Upload kotlin docs
uses: actions/upload-artifact@v4
with:
name: kotlin-docs-${{ github.run_id }}
path: docs/api/android
if-no-files-found: ignore
retention-days: 30
137 changes: 0 additions & 137 deletions .github/workflows/ci.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Web CI

on:
push:
branches: [release, develop]
paths:
- 'packages/**'
- '!packages/core/android/**'
- 'package*.json'
- 'lerna.json'
- '.github/workflows/web.yml'
pull_request:
branches: [release, develop]
paths:
- 'packages/**'
- '!packages/core/android/**'
- 'package*.json'
- 'lerna.json'
- '.github/workflows/web.yml'
workflow_dispatch:

permissions:
contents: read
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
web:
name: Web (lint+build+test+docs)
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip web]') }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint (if available)
run: |
if npm run lint --workspaces --if-present 2>/dev/null; then
echo "Workspace lint completed"
else
echo "No workspace lint found, trying root lint"
npm run lint || echo "No lint script found"
fi

- name: Type check (if available)
run: |
if npm run typecheck --workspaces --if-present 2>/dev/null; then
echo "Workspace typecheck completed"
else
echo "No workspace typecheck found, trying root typecheck"
npm run typecheck || echo "No typecheck script found"
fi

- name: Build packages
run: |
echo "Building with Lerna..."
npm run build

- name: Run tests
run: |
echo "Running tests with Lerna..."
npm run test:web || echo "No web tests found"

- name: Generate Web API docs
run: |
echo "Generating web docs..."
npm run docs:web || echo "No web docs script found"

- name: Upload web docs artifact
uses: actions/upload-artifact@v4
with:
name: web-docs-${{ github.run_id }}
path: docs/api/web
if-no-files-found: ignore
retention-days: 30

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: web-build-${{ github.run_id }}
path: |
packages/*/dist/
packages/*/build/
if-no-files-found: ignore
retention-days: 7
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# KompKit

[![CI](https://github.com/Kompkit/KompKit/actions/workflows/ci.yml/badge.svg?branch=release)](https://github.com/Kompkit/KompKit/actions/workflows/ci.yml)
[![Web CI](https://github.com/Kompkit/KompKit/actions/workflows/web.yml/badge.svg?branch=develop)](https://github.com/Kompkit/KompKit/actions/workflows/web.yml)
[![Kotlin CI](https://github.com/Kompkit/KompKit/actions/workflows/android.yml/badge.svg?branch=develop)](https://github.com/Kompkit/KompKit/actions/workflows/android.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Kotlin](https://img.shields.io/badge/Kotlin-0095D5?logo=kotlin&logoColor=white)](https://kotlinlang.org/)
Expand Down
Loading
Loading