Skip to content

Commit 65b8d04

Browse files
committed
WIP on testing samples
1 parent e705062 commit 65b8d04

File tree

3 files changed

+48
-5
lines changed

3 files changed

+48
-5
lines changed

.github/workflows/check.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,45 @@ jobs:
3030
outputs:
3131
matrix: ${{ steps.setup-matrix.outputs.matrix }}
3232

33+
34+
samples:
35+
# The type of runner that the job will run on
36+
runs-on: ${{ matrix.os }}
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os:
42+
- ubuntu-latest
43+
- macos-latest
44+
- windows-latest
45+
sample:
46+
- samples/app
47+
- samples/library
48+
49+
steps:
50+
# Checks-out your repository under $GITHUB_WORKSPACE for the job.
51+
- uses: actions/checkout@v2
52+
53+
- name: Setup Rust
54+
run: |
55+
rustup toolchain install stable
56+
rustup target add x86_64-linux-android
57+
rustup target add x86_64-unknown-linux-gnu
58+
rustup target add aarch64-linux-android
59+
60+
# Use Java 8
61+
- name: Setup Java 8
62+
uses: actions/setup-java@v2
63+
with:
64+
distribution: 'temurin'
65+
java-version: 8
66+
cache: 'gradle'
67+
68+
- name: ${{ matrix.sample }}
69+
run: |
70+
./gradlew -p ${{ matrix.sample }} :assembleDebug --info --warning-mode all
71+
3372
android_unversioned_tests:
3473
# The type of runner that the job will run on
3574
runs-on: ${{ matrix.os }}

samples/app/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.agp_version = '4.1.0'
2+
ext.agp_version = '7.0.0'
33
repositories {
44
google()
55
maven {
@@ -17,6 +17,8 @@ apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
1717

1818
android {
1919
compileSdkVersion 27
20+
ndkVersion "23.1.7779620"
21+
2022
defaultConfig {
2123
applicationId "com.nishtahir.androidrust"
2224
minSdkVersion 21
@@ -31,17 +33,17 @@ android {
3133
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3234
}
3335
}
34-
ndkVersion "20.1.5948944"
3536
}
3637

3738
cargo {
3839
module = "../rust"
39-
targets = ["arm", "x86", "x86_64", "arm64"]
40+
targets = ["x86_64", "arm64"]
4041
libname = "rust"
4142
}
4243

4344
repositories {
4445
google()
46+
mavenCentral()
4547
}
4648

4749
dependencies {

samples/library/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
buildscript {
2+
ext.agp_version = '7.0.0'
23
repositories {
34
google()
45
maven {
@@ -16,6 +17,7 @@ apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
1617

1718
android {
1819
compileSdkVersion 27
20+
ndkVersion "23.1.7779620"
1921

2022
defaultConfig {
2123
minSdkVersion 21
@@ -24,7 +26,6 @@ android {
2426
versionName "1.0"
2527

2628
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
27-
2829
}
2930
buildTypes {
3031
release {
@@ -36,7 +37,7 @@ android {
3637

3738
cargo {
3839
module = "../rust"
39-
targets = ["arm", "x86", "x86_64", "arm64"]
40+
targets = ["x86_64", "arm64"]
4041
libname = "rust"
4142

4243
features {
@@ -52,6 +53,7 @@ cargo {
5253

5354
repositories {
5455
google()
56+
mavenCentral()
5557
}
5658

5759
dependencies {

0 commit comments

Comments
 (0)