-
-
Notifications
You must be signed in to change notification settings - Fork 5
88 lines (70 loc) · 2.51 KB
/
test-pull-request.yml
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
name: CI
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
env:
GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
jobs:
Test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{matrix.os}}
if: github.repository == 'MayakaApps/Kache'
permissions:
contents: read
checks: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Extract Kotlin version - Linux and macOS
if: matrix.os != 'windows-latest'
run: |
echo "KOTLIN_VERSION=$(sed -rn 's/^kotlin[[:space:]]?=[[:space:]]?\"(.*)\"/\1/p' 'gradle/libs.versions.toml')" >> $GITHUB_ENV
- name: Extract Kotlin version - Windows
if: matrix.os == 'windows-latest'
run: |
powershell -command "echo "KOTLIN_VERSION=$((Select-String -Path 'gradle/libs.versions.toml' -Pattern '^kotlin\s?=\s?\"(.*)\"').Matches.Groups[1].Value)" >> $env:GITHUB_ENV"
- name: Restore Konan cache
uses: actions/cache/restore@v3
id: restore-cache
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ env.KOTLIN_VERSION }}
- name: Run JVM, JS, WASM, and linuxX64 tests
if: matrix.os == 'ubuntu-latest'
run: ./gradlew jvmTest jsTest linuxX64Test --stacktrace
- name: Run mingwX64 tests
if: matrix.os == 'windows-latest'
run: ./gradlew mingwX64Test --stacktrace
- name: Run macosX64, macosArm64, iosX64, and iosSimulatorArm64 tests
if: matrix.os == 'macOS-latest'
run: |
./gradlew macosX64Test macosArm64Test iosX64Test iosSimulatorArm64Test --stacktrace
- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v3
with:
name: error-report
path: build-reports.zip
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
check_name: ${{ runner.os }} Test Report