Repository navigation
82 lines (70 loc) · 2.83 KB
/
Copy pathschema-validation.yml
File metadata and controls
82 lines (70 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Schema Validation
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
paths:
- 'skainet-lang/**'
- '.github/workflows/schema-validation.yml'
# Set default permission for all jobs to none
permissions: {}
jobs:
validate-schema:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 25
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: '25'
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Configuring the project graph reaches skainet-backend-jni-cpu, whose
# Android plugin needs the pinned NDK. If it is absent, AGP downloads it
# mid-configuration with no retry, which fails the job on transient
# network errors (e.g. "Premature EOF"). Install it up front with
# retries instead. The version must match gradle/libs.versions.toml
# `android-ndk`.
- name: Install pinned NDK
run: |
NDK_VERSION="$(grep -E '^android-ndk[[:space:]]*=' gradle/libs.versions.toml | sed -E 's/.*"([^"]+)".*/\1/')"
# sdkmanager is not on PATH on the plain ubuntu runner; use the
# preinstalled SDK's copy directly.
SDKMANAGER="${ANDROID_HOME:-/usr/local/lib/android/sdk}/cmdline-tools/latest/bin/sdkmanager"
echo "Installing NDK ${NDK_VERSION}"
for attempt in 1 2 3; do
if yes | "$SDKMANAGER" "ndk;${NDK_VERSION}" >/dev/null; then
exit 0
fi
echo "sdkmanager attempt ${attempt} failed, retrying..."
sleep 10
done
echo "Failed to install NDK ${NDK_VERSION} after 3 attempts" >&2
exit 1
- name: Generate operator documentation (KSP)
run: ./gradlew :skainet-lang:skainet-lang-core:kspCommonMainKotlinMetadata
- name: Validate JSON schema via Gradle plugin
run: ./gradlew validateOperatorSchema
- name: Upload validation artifacts
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: validation-logs
path: |
**/build/generated/**/*.json
**/build/logs/
retention-days: 7