Skip to content

Commit af4deba

Browse files
authored
Merge pull request #241 from thisisthepy/feat/klib-ios-ci
CI: Run the klib fixture's suite on the iOS simulator on develop pushes
2 parents 9154caa + 4314626 commit af4deba

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

‎.github/workflows/ios.yml‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,55 @@ jobs:
3939
- name: Compile iOS Simulator Arm64
4040
# Compile iOS Simulator which includes commonMain + nativeMain + iosMain
4141
run: ./gradlew :python-multiplatform:compileKotlinIosSimulatorArm64 --console=plain
42+
43+
# The klib walker on Kotlin/Native (#234, #237, #240): object handles, their lifetime and member
44+
# functions, called from Python on the iOS simulator. Its own job and Gradle invocation.
45+
klib-fixture:
46+
name: Klib fixture on the iOS simulator
47+
runs-on: macos-latest
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Java
53+
uses: actions/setup-java@v4
54+
with:
55+
java-version: '21'
56+
distribution: 'zulu'
57+
cache: 'gradle'
58+
59+
- name: Cache Konan
60+
uses: actions/cache@v4
61+
with:
62+
path: ~/.konan
63+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
64+
restore-keys: |
65+
${{ runner.os }}-konan-
66+
67+
- name: Run the klib fixture's suite
68+
run: ./gradlew :python-multiplatform-gradle-plugin-fixtures:klib-artifact:iosSimulatorArm64Test --rerun --console=plain
69+
70+
- name: Count the tests
71+
if: always()
72+
run: |
73+
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
74+
import glob, xml.etree.ElementTree as ET
75+
files = glob.glob("python-multiplatform-gradle-plugin/fixtures/klib-artifact/build/test-results/iosSimulatorArm64Test/*.xml")
76+
total = failed = skipped = 0
77+
for f in files:
78+
suite = ET.parse(f).getroot()
79+
total += int(suite.get("tests", 0))
80+
failed += int(suite.get("failures", 0)) + int(suite.get("errors", 0))
81+
skipped += int(suite.get("skipped", 0))
82+
print(f"Klib fixture (iOS simulator): {total} tests, {total - failed - skipped} passed, {failed} failed, {skipped} skipped ({len(files)} suites)")
83+
PY
84+
cat "$GITHUB_STEP_SUMMARY"
85+
86+
- name: Upload the test reports
87+
if: failure()
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: klib-fixture-ios-reports
91+
path: |
92+
python-multiplatform-gradle-plugin/fixtures/klib-artifact/build/reports/tests/iosSimulatorArm64Test
93+
python-multiplatform-gradle-plugin/fixtures/klib-artifact/build/test-results/iosSimulatorArm64Test

‎docs/SPEC.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ All in `PM/commonTest`, so they run wherever the interpreter loads.
438438
`python-multiplatform-gradle-plugin/fixtures/klib-artifact` builds `androidNativeArm64` and
439439
`iosSimulatorArm64` from one table in `nativeMain`, and its suite (`WalkedKlibArtifactHandleTest`,
440440
`WalkedKlibArtifactTableTest`, `WalkedKlibArtifactPythonImportTest`) runs through Gradle on the iOS
441-
simulator (`iosSimulatorArm64Test`); on androidNative it is linked by the build and run by hand.
441+
simulator (`iosSimulatorArm64Test`, and on CI in `ios.yml`'s `klib-fixture` job, #240); on
442+
androidNative it is linked by the build and run by hand.
442443
- **B-3** Default arguments can be omitted from Python (a call per subset of defaulted parameters,
443444
ambiguous omissions refused). `Status: implemented`, `GP/artifact/DefaultOmissionTest.kt`,
444445
`python-multiplatform-gradle-plugin/fixtures/artifact/.../WalkedArtifactDefaultOmissionTest.kt`, `PM/commonTest/.../PythonxDefaultsTest.kt`.

0 commit comments

Comments
 (0)