Merge pull request #553 from hyb1996/github-action-test

GitHub actions
This commit is contained in:
Stardust
2019-12-01 21:28:31 +08:00
committed by GitHub
6 changed files with 35 additions and 19 deletions

23
.github/workflows/android.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Android CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: chmod 777 ./gradlew && ./gradlew :app:assembleRelease && find app/build/outputs
- name: Upload apk
uses: actions/upload-artifact@v1
with:
name: app-armeabi-v7a-release-unsigned.apk
path: app/build/outputs/apk/common/release/app-common-armeabi-v7a-release-unsigned.apk

View File

@@ -27,6 +27,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
}
repositories {

View File

@@ -25,23 +25,6 @@ public class ExampleUnitTest {
@Test
public void test() throws IOException {
File file = new File("C:\\Users\\Stardust\\Desktop\\1.txt");
System.out.println(PFiles.read(file));
String url = "http://posttestserver.com/post.php?dir=example";
OkHttpClient client = new OkHttpClient();
RequestBody formBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", file.getName(),
RequestBody.create(MediaType.parse("text/plain"), file))
.addFormDataPart("other_field", "other_field_value")
.build();
Request request = new Request.Builder().url(url).post(formBody).build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
public void test() {
}
public boolean equals(int i, int j) {
return i == j;
}
}
}

View File

@@ -19,6 +19,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false

View File

@@ -22,6 +22,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {

View File

@@ -16,6 +16,7 @@ android {
multiDexEnabled true
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
disable 'ExtraTranslation'
}