generated from Kotlin/multiplatform-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (103 loc) · 3.45 KB
/
test.yml
File metadata and controls
117 lines (103 loc) · 3.45 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Test
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
abi-check:
name: "checkLegacyAbi"
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Run ABI compatibility check
run: ./gradlew checkLegacyAbi --no-configuration-cache
test:
name: "${{ matrix.os }} / ${{ matrix.target }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: "jvmTest"
- os: ubuntu-latest
target: "jsNodeTest"
- os: ubuntu-latest
target: "wasmJsNodeTest"
- os: ubuntu-latest
target: "testAndroidHostTest"
- os: macos-latest
target: "iosSimulatorArm64Test"
- os: macos-latest
target: "macosArm64Test"
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Run test target
id: run_tests
run: |
set -o pipefail
if [ "${{ matrix.target }}" = "jvmTest" ]; then
./gradlew ${{ matrix.target }} --no-configuration-cache | tee jvm-test.log
else
./gradlew ${{ matrix.target }} --no-configuration-cache
fi
- name: Publish jvm perf profile summary
if: ${{ always() && matrix.target == 'jvmTest' }}
run: |
profile_line="$(
grep -Rho -m1 'PERF_PROFILE [^<]*' jvm-test.log library/build/test-results/jvmTest 2>/dev/null | head -n1 || true
)"
memory_line="$(
grep -Rho -m1 'PERF_MEMORY [^<]*' jvm-test.log library/build/test-results/jvmTest 2>/dev/null | head -n1 || true
)"
{
echo "## JVM Performance Profile"
if [ "${{ steps.run_tests.outcome }}" = "success" ]; then
echo "- Test step result: ✅ Passed"
else
echo "- Test step result: ❌ Failed"
fi
echo ""
if [ -n "$profile_line" ]; then
echo '```text'
echo "$profile_line"
echo '```'
else
echo "- PERF_PROFILE line not found."
fi
echo ""
if [ -n "$memory_line" ]; then
echo "### Memory Observation"
echo '```text'
echo "$memory_line"
echo '```'
else
echo "### Memory Observation"
echo "- PERF_MEMORY line not found."
fi
} >> "$GITHUB_STEP_SUMMARY"