-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (57 loc) · 2.37 KB
/
Copy pathapi-check.yml
File metadata and controls
65 lines (57 loc) · 2.37 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
name: Public API check
# Guards the committed public-API dumps (sharingan/api, sharingan-noop/api).
#
# Two complementary gates live here:
# - api-check : apiCheck fails when a module's surface drifts from its own
# committed dump (an accidental signature change between releases).
# - api-parity : checkApiParity fails when :sharingan and :sharingan-noop drift
# from EACH OTHER, i.e. they no longer expose an identical public contract
# (issue #12). This is what makes the "swap sharingan-noop in release" safety
# story enforceable rather than dependent on human discipline.
# Regenerate intentional changes locally with `./gradlew apiDump` and commit.
#
# Docs/site-only changes skip both jobs (paths-ignore): a markdown/CSS edit can't
# alter the Kotlin public-API surface, and these jobs only diff the committed
# *.api / *.klib.api dumps — they never run the library code. Skipping mirrors
# build.yml's docs gate (and is safe because `main` has no required status check
# that a path-filtered skip could leave pending). Any PR that also touches
# code/build files still runs the full API gate.
on:
pull_request:
paths-ignore:
- "**.md"
- "docs/**"
- "site/**"
- ".github/workflows/pages.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
api-check:
# macOS so the Kotlin/Native (iOS) klib ABI targets build, matching the
# committed *.klib.api dumps; the Android/JVM dumps are checked here too.
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Check public API against committed dumps
run: ./gradlew apiCheck
api-parity:
# Cross-module parity is a pure text comparison of the four committed dumps —
# no Android/iOS SDK, no compilation, no Kotlin/Native link — so it runs on
# cheap ubuntu for fast, independent feedback (it does NOT need the macOS host
# the api-check job above requires).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Assert :sharingan and :sharingan-noop expose an identical public contract
run: ./gradlew checkApiParity