Skip to content

Commit 9354ea3

Browse files
committed
Merge branch 'AUT-2-SetupCircleCIWithMacOS' into hotfix/superuser/FixCrashOnConnectionLost
2 parents d61d421 + d447f78 commit 9354ea3

File tree

19 files changed

+469
-81
lines changed

19 files changed

+469
-81
lines changed

.circleci/config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 2.1
2+
3+
jobs:
4+
android-test:
5+
macos:
6+
xcode: "11.2.0"
7+
working_directory: ~/repo/App
8+
steps:
9+
- checkout:
10+
path: ~/repo
11+
12+
- run:
13+
name: set ANDROID_SDK_ROOT
14+
command: |
15+
echo 'export ANDROID_SDK_ROOT=$HOME/android-tools' >> $BASH_ENV
16+
17+
- restore_cache:
18+
key: android=tools-v1-{{ checksum "scripts/install-android-tools.sh" }}-{{ arch }}
19+
20+
- run:
21+
name: install android tools
22+
command: |
23+
sh scripts/install-android-tools.sh
24+
echo 'export PATH=$ANDROID_SDK_ROOT/tools/bin:$PATH' >> $BASH_ENV
25+
echo 'export PATH=$ANDROID_SDK_ROOT/tools:$PATH' >> $BASH_ENV
26+
echo 'export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH' >> $BASH_ENV
27+
echo 'export PATH=$ANDROID_SDK_ROOT/emulator:$PATH' >> $BASH_ENV
28+
source $BASH_ENV
29+
sdkmanager --list
30+
31+
- save_cache:
32+
key: android=tools-v1-{{ checksum "scripts/install-android-tools.sh" }}-{{ arch }}
33+
paths:
34+
- /Users/distiller/android-tools
35+
36+
- run:
37+
name: create AVD
38+
command: make create-avd
39+
40+
- run:
41+
name: start AVD
42+
command: emulator-headless -avd android-tablet
43+
background: true
44+
45+
- run:
46+
name: wait for emulator
47+
command: adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;'
48+
49+
- run: adb shell screencap -p > screenshots/before.png
50+
51+
# (insert testing here)
52+
53+
- store_artifacts:
54+
path: screenshots
55+
56+
workflows:
57+
workflow:
58+
jobs:
59+
- android-test

.github/workflows/android.yml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,54 @@
11
name: Android CI
22

3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
3+
on: [push]
84

95
jobs:
10-
build:
116

7+
unit-test:
128
runs-on: ubuntu-latest
13-
149
steps:
1510
- uses: actions/checkout@v2
11+
- name: set up Ruby to install fastlane
12+
uses: actions/setup-ruby@v1
13+
with:
14+
ruby-version: '2.7'
1615
- name: set up JDK 1.8
1716
uses: actions/setup-java@v1
1817
with:
1918
java-version: 1.8
20-
- name: Build with Gradle
21-
run: ./gradlew build
19+
- name: setup fastlane
20+
run: bundle install
21+
- name: run unit tests
22+
run: bundle exec fastlane android run_unit_tests
23+
- name: Unit tests results
24+
uses: actions/upload-artifact@v1
25+
with:
26+
name: unit-test-results
27+
path: app/build/reports/tests/testDebugUnitTest/index.html
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v1
33+
- name: set up JDK 1.8
34+
uses: actions/setup-java@v1
35+
with:
36+
java-version: 1.8
37+
- name: Lint
38+
run: bash ./gradlew lint --stacktrace
39+
- name: Lint results
40+
uses: actions/upload-artifact@v1
41+
with:
42+
name: app
43+
path: app/build/reports/lint-results.html
44+
45+
ui-test:
46+
runs-on: macOS-latest
47+
steps:
48+
- name: checkout
49+
uses: actions/checkout@v2
50+
- name: run tests
51+
uses: reactivecircus/android-emulator-runner@v2
52+
with:
53+
api-level: 29
54+
script: ./gradlew connectedCheck

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,17 @@ lint/outputs/
8282
lint/tmp/
8383
# lint/reports/
8484
app/src/main/res/values/api_keys.xml
85+
.idea/compiler.xml
86+
.idea/compiler.xml
87+
.idea/compiler.xml
88+
.idea/jarRepositories.xml
89+
.idea/misc.xml
90+
app/build.gradle
91+
.idea/misc.xml
92+
.idea/misc.xml
93+
.idea/misc.xml
94+
.idea/misc.xml
95+
.idea/misc.xml
96+
.idea/.name
97+
.idea/codeStyles/Project.xml
98+
.idea/misc.xml

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"

Gemfile.lock

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.3)
5+
addressable (2.7.0)
6+
public_suffix (>= 2.0.2, < 5.0)
7+
artifactory (3.0.15)
8+
atomos (0.1.3)
9+
aws-eventstream (1.1.0)
10+
aws-partitions (1.416.0)
11+
aws-sdk-core (3.111.0)
12+
aws-eventstream (~> 1, >= 1.0.2)
13+
aws-partitions (~> 1, >= 1.239.0)
14+
aws-sigv4 (~> 1.1)
15+
jmespath (~> 1.0)
16+
aws-sdk-kms (1.41.0)
17+
aws-sdk-core (~> 3, >= 3.109.0)
18+
aws-sigv4 (~> 1.1)
19+
aws-sdk-s3 (1.87.0)
20+
aws-sdk-core (~> 3, >= 3.109.0)
21+
aws-sdk-kms (~> 1)
22+
aws-sigv4 (~> 1.1)
23+
aws-sigv4 (1.2.2)
24+
aws-eventstream (~> 1, >= 1.0.2)
25+
babosa (1.0.4)
26+
claide (1.0.3)
27+
colored (1.2)
28+
colored2 (3.1.2)
29+
commander-fastlane (4.4.6)
30+
highline (~> 1.7.2)
31+
declarative (0.0.20)
32+
declarative-option (0.1.0)
33+
digest-crc (0.6.3)
34+
rake (>= 12.0.0, < 14.0.0)
35+
domain_name (0.5.20190701)
36+
unf (>= 0.0.5, < 1.0.0)
37+
dotenv (2.7.6)
38+
emoji_regex (3.2.1)
39+
excon (0.78.1)
40+
faraday (1.3.0)
41+
faraday-net_http (~> 1.0)
42+
multipart-post (>= 1.2, < 3)
43+
ruby2_keywords
44+
faraday-cookie_jar (0.0.7)
45+
faraday (>= 0.8.0)
46+
http-cookie (~> 1.0.0)
47+
faraday-net_http (1.0.1)
48+
faraday_middleware (1.0.0)
49+
faraday (~> 1.0)
50+
fastimage (2.2.1)
51+
fastlane (2.172.0)
52+
CFPropertyList (>= 2.3, < 4.0.0)
53+
addressable (>= 2.3, < 3.0.0)
54+
artifactory (~> 3.0)
55+
aws-sdk-s3 (~> 1.0)
56+
babosa (>= 1.0.3, < 2.0.0)
57+
bundler (>= 1.12.0, < 3.0.0)
58+
colored
59+
commander-fastlane (>= 4.4.6, < 5.0.0)
60+
dotenv (>= 2.1.1, < 3.0.0)
61+
emoji_regex (>= 0.1, < 4.0)
62+
excon (>= 0.71.0, < 1.0.0)
63+
faraday (~> 1.0)
64+
faraday-cookie_jar (~> 0.0.6)
65+
faraday_middleware (~> 1.0)
66+
fastimage (>= 2.1.0, < 3.0.0)
67+
gh_inspector (>= 1.1.2, < 2.0.0)
68+
google-api-client (>= 0.37.0, < 0.39.0)
69+
google-cloud-storage (>= 1.15.0, < 2.0.0)
70+
highline (>= 1.7.2, < 2.0.0)
71+
json (< 3.0.0)
72+
jwt (>= 2.1.0, < 3)
73+
mini_magick (>= 4.9.4, < 5.0.0)
74+
multipart-post (~> 2.0.0)
75+
plist (>= 3.1.0, < 4.0.0)
76+
rubyzip (>= 2.0.0, < 3.0.0)
77+
security (= 0.1.3)
78+
simctl (~> 1.6.3)
79+
slack-notifier (>= 2.0.0, < 3.0.0)
80+
terminal-notifier (>= 2.0.0, < 3.0.0)
81+
terminal-table (>= 1.4.5, < 2.0.0)
82+
tty-screen (>= 0.6.3, < 1.0.0)
83+
tty-spinner (>= 0.8.0, < 1.0.0)
84+
word_wrap (~> 1.0.0)
85+
xcodeproj (>= 1.13.0, < 2.0.0)
86+
xcpretty (~> 0.3.0)
87+
xcpretty-travis-formatter (>= 0.0.3)
88+
gh_inspector (1.1.3)
89+
google-api-client (0.38.0)
90+
addressable (~> 2.5, >= 2.5.1)
91+
googleauth (~> 0.9)
92+
httpclient (>= 2.8.1, < 3.0)
93+
mini_mime (~> 1.0)
94+
representable (~> 3.0)
95+
retriable (>= 2.0, < 4.0)
96+
signet (~> 0.12)
97+
google-cloud-core (1.5.0)
98+
google-cloud-env (~> 1.0)
99+
google-cloud-errors (~> 1.0)
100+
google-cloud-env (1.4.0)
101+
faraday (>= 0.17.3, < 2.0)
102+
google-cloud-errors (1.0.1)
103+
google-cloud-storage (1.29.2)
104+
addressable (~> 2.5)
105+
digest-crc (~> 0.4)
106+
google-api-client (~> 0.33)
107+
google-cloud-core (~> 1.2)
108+
googleauth (~> 0.9)
109+
mini_mime (~> 1.0)
110+
googleauth (0.14.0)
111+
faraday (>= 0.17.3, < 2.0)
112+
jwt (>= 1.4, < 3.0)
113+
memoist (~> 0.16)
114+
multi_json (~> 1.11)
115+
os (>= 0.9, < 2.0)
116+
signet (~> 0.14)
117+
highline (1.7.10)
118+
http-cookie (1.0.3)
119+
domain_name (~> 0.5)
120+
httpclient (2.8.3)
121+
jmespath (1.4.0)
122+
json (2.5.1)
123+
jwt (2.2.2)
124+
memoist (0.16.2)
125+
mini_magick (4.11.0)
126+
mini_mime (1.0.2)
127+
multi_json (1.15.0)
128+
multipart-post (2.0.0)
129+
nanaimo (0.3.0)
130+
naturally (2.2.0)
131+
os (1.1.1)
132+
plist (3.6.0)
133+
public_suffix (4.0.6)
134+
rake (13.0.3)
135+
representable (3.0.4)
136+
declarative (< 0.1.0)
137+
declarative-option (< 0.2.0)
138+
uber (< 0.2.0)
139+
retriable (3.1.2)
140+
rouge (2.0.7)
141+
ruby2_keywords (0.0.2)
142+
rubyzip (2.3.0)
143+
security (0.1.3)
144+
signet (0.14.0)
145+
addressable (~> 2.3)
146+
faraday (>= 0.17.3, < 2.0)
147+
jwt (>= 1.5, < 3.0)
148+
multi_json (~> 1.10)
149+
simctl (1.6.8)
150+
CFPropertyList
151+
naturally
152+
slack-notifier (2.3.2)
153+
terminal-notifier (2.0.0)
154+
terminal-table (1.8.0)
155+
unicode-display_width (~> 1.1, >= 1.1.1)
156+
tty-cursor (0.7.1)
157+
tty-screen (0.8.1)
158+
tty-spinner (0.9.3)
159+
tty-cursor (~> 0.7)
160+
uber (0.1.0)
161+
unf (0.1.4)
162+
unf_ext
163+
unf_ext (0.0.7.7-x64-mingw32)
164+
unicode-display_width (1.7.0)
165+
word_wrap (1.0.0)
166+
xcodeproj (1.19.0)
167+
CFPropertyList (>= 2.3.3, < 4.0)
168+
atomos (~> 0.1.3)
169+
claide (>= 1.0.2, < 2.0)
170+
colored2 (~> 3.1)
171+
nanaimo (~> 0.3.0)
172+
xcpretty (0.3.0)
173+
rouge (~> 2.0.7)
174+
xcpretty-travis-formatter (1.0.1)
175+
xcpretty (~> 0.2, >= 0.0.7)
176+
177+
PLATFORMS
178+
x64-mingw32
179+
180+
DEPENDENCIES
181+
fastlane
182+
183+
BUNDLED WITH
184+
2.1.4

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# arduino-usb-terminal
44
Terminal-like app to send commands to Arduino through USB
55

6-
6+
![Android CI](https://github.com/k4biri/arduino-usb-terminal/workflows/Android%20CI/badge.svg)
7+
78

89
This app simplifies testing your Arduino components that work with direct usb commands by giving you the ability to send custom commands and view the returned message from your Arduino device.
910

@@ -23,7 +24,8 @@
2324
The Joystick is removed for the first release.
2425

2526
## Tests
26-
Under Construction
27+
Currently, there are some basic tests to run on the CI, but needs improvements.
28+
UI tests will be completed once the project is migrated to Jetpack Compose.
2729

2830
## Sentry Reports
2931
The project uses Sentry for the crash reports, if this is not needed, you can remove the following line in `AndroidManifest.xml`:

0 commit comments

Comments
 (0)