This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
79 lines (75 loc) · 2.47 KB
/
tests.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
name: Tests
on: [push]
jobs:
all:
name: Find all examples
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.build-matrix.outputs.languages }}
steps:
- uses: actions/checkout@v2
- name: discover all examples
id: build-matrix
run: node .github/generate-test-steps.js >> "$GITHUB_OUTPUT"
javascript:
name: JavaScript (${{ matrix.example.name }})
needs: all
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{ fromJSON(needs.all.outputs.languages).javascript }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '20.4.0'
- name: test setup
run: ${{ matrix.example.preTestCommands }}
working-directory: javascript/${{ matrix.example.name }}
if: matrix.example.preTestCommands != null
- name: test
run: ${{ matrix.example.testCommands }}
working-directory: javascript/${{ matrix.example.name }}
kotlin:
name: Kotlin (${{ matrix.example.name }})
needs: all
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{ fromJSON(needs.all.outputs.languages).kotlin }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Enable KVM
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: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: test setup
run: ${{ matrix.example.preTestCommands }}
working-directory: kotlin/${{ matrix.example.name }}
if: matrix.example.preTestCommands != null
- name: test in android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ${{ matrix.example.testCommands }}
working-directory: kotlin/${{ matrix.example.name }}