Skip to content

Commit 469e177

Browse files
committed
Add github actions
1 parent 12257ed commit 469e177

4 files changed

Lines changed: 132 additions & 0 deletions

File tree

.github/ci-gradle.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
org.gradle.daemon=false
2+
org.gradle.workers.max=2
3+
4+
# Disable parallel execution to reduce memory pressure and AAPT2 flakiness
5+
org.gradle.parallel=false
6+
org.gradle.caching=true
7+
org.gradle.configuration-cache=true
8+
9+
# Memory tuning
10+
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
11+
12+
# Kotlin daemon memory cap to reduce OOM risk
13+
kotlin.daemon.jvmargs=-Xmx1g
14+
kotlin.incremental=true
15+
kotlin.compiler.execution.strategy=daemon
16+
17+
# Disable AAPT2 daemon to prevent "daemon unexpectedly exit" crashes
18+
android.aapt2.daemon=false

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
open-pull-requests-limit: 30
6+
schedule:
7+
interval: "daily"
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build & Test
2+
3+
on: [ push, pull_request ]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build-job:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 60
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
18+
- name: Copy CI gradle.properties
19+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
20+
21+
- name: Set up JDK 25
22+
uses: actions/setup-java@v5
23+
with:
24+
distribution: 'zulu'
25+
java-version: 25
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: '20'
31+
32+
- name: Disk space (observability)
33+
run: df -h
34+
35+
- name: Build and Test (PR)
36+
if: github.event_name == 'pull_request'
37+
env:
38+
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4g -Dfile.encoding=UTF-8"
39+
run: |
40+
./gradlew --no-daemon --stacktrace --info \
41+
-Dorg.gradle.caching=true \
42+
-Dorg.gradle.configuration-cache=true \
43+
clean assemble allTests
44+
45+
- name: Build and Test (push)
46+
if: github.event_name != 'pull_request'
47+
env:
48+
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4g -Dfile.encoding=UTF-8"
49+
run: |
50+
./gradlew --no-daemon --stacktrace --info \
51+
-Dorg.gradle.caching=true \
52+
-Dorg.gradle.configuration-cache=true \
53+
assemble allTests
54+
55+
- name: Memory info (on failure)
56+
if: failure()
57+
run: |
58+
free -h || true
59+
cat /proc/meminfo | head -n 50 || true
60+
61+
- name: Upload all test reports
62+
if: always()
63+
uses: actions/upload-artifact@v7
64+
with:
65+
name: test-reports
66+
path: |
67+
**/build/reports/tests/**
68+
**/build/test-results/**
69+
retention-days: 14

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
publish:
10+
name: Release build and publish
11+
runs-on: macOS-latest
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v6
15+
- name: Set up JDK 25
16+
uses: actions/setup-java@v5
17+
with:
18+
distribution: 'zulu'
19+
java-version: 25
20+
- name: Validate signing configuration
21+
run: |
22+
if ! grep -Eq '^[[:space:]]*signAllPublications[[:space:]]*=[[:space:]]*true[[:space:]]*$' gradle.properties; then
23+
echo "signAllPublications must be set to true in gradle.properties to publish." >&2
24+
echo "Current setting:" >&2
25+
grep -n 'signAllPublications' gradle.properties || echo "No signAllPublications property found" >&2
26+
exit 1
27+
fi
28+
- name: Publish to MavenCentral
29+
run: ./gradlew publish --no-configuration-cache --stacktrace
30+
env:
31+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
32+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
34+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

0 commit comments

Comments
 (0)