-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (70 loc) · 2.53 KB
/
Copy pathci.yaml
File metadata and controls
75 lines (70 loc) · 2.53 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
# https://github.com/Kotlin/multiplatform-library-template/blob/main/.github/workflows/gradle.yml
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
cmd: "./gradlew :kmp-xlog:testDebugUnitTest"
- os: ubuntu-latest
androidEmulator: true
cmd: "./gradlew :example:androidApp:connectedCheck"
- os: macos-latest
dep: "brew update && brew install xcodegen"
cmd: "./scripts/build_apple.sh && ./gradlew runKmp_xlogDebugExecutableMacosX64 && ./scripts/build_mac_demo.sh && ./scripts/build_ios_demo.sh"
- os: ubuntu-22.04
dep: "sudo apt-get update && sudo apt-get install zlib1g-dev"
cmd: "./scripts/build_xlog_linux.sh && ./gradlew runKmp_xlogDebugExecutableLinuxX64"
- os: windows-latest
cmd: "./gradlew runKmp_xlogDebugExecutableMingwX64"
- os: macos-latest
cmd: "./gradlew :example:shared:jsBrowserDistribution && ./gradlew :example:shared:wasmJsBrowserDistribution && ./gradlew :example:shared:wasmWasiNodeDevelopmentRun"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Install deps
if: ${{ matrix.dep }}
run: ${{ matrix.dep }}
- name: Enable KVM for Android Emulator
if: ${{ matrix.androidEmulator }}
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run normal
if: ${{ !matrix.androidEmulator }}
run: ${{ matrix.cmd }}
- name: Run Android connected check
if: ${{ matrix.androidEmulator }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
ndk: 21.3.6528147
cmake: 3.18.1
script: ${{ matrix.cmd }}