1010
1111jobs :
1212 mocha-android :
13- runs-on : macos-12
13+ runs-on : ubuntu-latest
1414 timeout-minutes : 120
1515
1616 steps :
1717 - name : Checkout
18- uses : actions/checkout@v3
18+ uses : actions/checkout@v4
1919 with :
2020 fetch-depth : 1
2121
22- - name : Setup Docker Colima 1
23- uses : douglascamata/setup-docker-macos-action@v1-alpha
24- id : docker1
25- continue-on-error : true
22+ - name : Enable KVM group perms
23+ run : |
24+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
25+ sudo udevadm control --reload-rules
26+ sudo udevadm trigger --name-match=kvm
27+
28+ - name : Free Disk Space
29+ uses : jlumbroso/free-disk-space@main
2630 with :
27- lima : v0.18.0
28- colima : v0.5.6
29-
30- - name : Setup Docker Colima 2
31- if : steps.docker1.outcome != 'success'
32- uses : douglascamata/setup-docker-macos-action@v1-alpha
33- id : docker2
34- continue-on-error : true
31+ # this might remove tools that are actually needed,
32+ # if set to "true" but frees about 6 GB
33+ tool-cache : false
34+ android : false
35+ dotnet : true
36+ haskell : true
37+ large-packages : true
38+ docker-images : true
39+ swap-storage : true
40+
41+ - name : yarn and gradle caches in /mnt
42+ run : |
43+ rm -rf ~/.yarn
44+ rm -rf ~/.gradle
45+ sudo mkdir -p /mnt/.yarn
46+ sudo mkdir -p /mnt/.gradle
47+ sudo chown -R runner /mnt/.yarn
48+ sudo chown -R runner /mnt/.gradle
49+ ln -s /mnt/.yarn /home/runner/
50+ ln -s /mnt/.gradle /home/runner/
51+
52+ - name : Create artifacts directory on /mnt
53+ run : |
54+ sudo mkdir -p /mnt/artifacts
55+ sudo chown -R runner /mnt/artifacts
56+
57+ - name : Node
58+ uses : actions/setup-node@v4
3559 with :
36- lima : v0.18.0
37- colima : v0.5.6
60+ node-version : 20
3861
39- - name : Setup Docker Default
40- if : steps.docker1.outcome != 'success' && steps.docker2.outcome != 'success'
41- uses :
docker-practice/[email protected] 42- timeout-minutes : 30
62+ - name : Use yarn caches
63+ uses : actions/cache@v4
64+ with :
65+ path : ~/.yarn
66+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
67+ restore-keys : |
68+ ${{ runner.os }}-yarn-
4369
4470 - name : Run regtest setup
4571 working-directory : example/docker
5379 timeout-minutes : 2
5480 run : while ! nc -z '127.0.0.1' 60001; do sleep 1; done
5581
56- - name : Node
57- uses : actions/setup-node@v3
58- with :
59- node-version : 18
60- cache : ' yarn' # cache packages, but not node_modules
61- cache-dependency-path : ' example/yarn.lock'
62-
63- - name : Cache lib node modules
64- uses : actions/cache@v3
65- id : lib-npmcache
66- with :
67- path : lib/node_modules
68- key : node-modules-${{ hashFiles('**/yarn.lock') }}
69-
7082 - name : Install lib dependencies
71- if : steps.lib-npmcache.outputs.cache-hit != 'true'
7283 working-directory : lib
73- run : yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline
84+ run : yarn || yarn
7485
7586 - name : Build lib
7687 working-directory : lib
@@ -84,31 +95,32 @@ jobs:
8495 restore-keys : |
8596 ${{ runner.os }}-gradle-
8697
87- # - name: Cache node modules
88- # uses: actions/cache@v3
89- # id: cache-nm
90- # with:
91- # path: node_modules
92- # key: node-modules-${{ hashFiles('**/yarn.lock') }}
93-
9498 - name : Install node_modules
9599 working-directory : example
96- run : yarn install && yarn rn-setup
100+ run : ( yarn || yarn) && yarn rn-setup
97101
98102 - name : Use specific Java version for sdkmanager to work
99- uses : actions/setup-java@v2
103+ uses : actions/setup-java@v4
100104 with :
101105 distribution : ' temurin'
102- java-version : ' 11 '
106+ java-version : ' 17 '
103107
104- # - name: Build
105- # working-directory: example
106- # run: npx react-native run-android --no-packager
108+ - name : Build
109+ uses : reactivecircus/android-emulator-runner@v2
110+ with :
111+ api-level : 34
112+ avd-name : Pixel_API_31_AOSP
113+ emulator-options : -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
114+ arch : x86_64
115+ disable-animations : true
116+ working-directory : example
117+ script : |
118+ npx react-native run-android --no-packager
107119
108120 - name : run tests
109121 uses : reactivecircus/android-emulator-runner@v2
110122 with :
111- api-level : 31
123+ api-level : 34
112124 avd-name : Pixel_API_31_AOSP
113125 emulator-options : -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
114126 arch : x86_64
@@ -117,8 +129,8 @@ jobs:
117129 script : |
118130 ../.github/workflows/mocha-anrdoid.sh
119131
120- - uses : actions/upload-artifact@v3
132+ - uses : actions/upload-artifact@v4
121133 if : failure()
122134 with :
123135 name : ldk-data
124- path : example/artifacts/
136+ path : /mnt/artifacts
0 commit comments