-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from SecUSo/add-workflows
Add workflows and fix lint errors
- Loading branch information
Showing
30 changed files
with
1,679 additions
and
1,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Continuous Integration | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Set up JDK environment | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: 17 | ||
|
||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Run local unit tests | ||
run: bash ./gradlew test --stacktrace | ||
|
||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Set up JDK environment | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: 17 | ||
|
||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Run lint check | ||
run: bash ./gradlew lint | ||
|
||
- name: Upload lint result | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lint-results-debug | ||
path: app/build/reports/lint-results-debug.html | ||
|
||
- name: Build the app | ||
run: bash ./gradlew build --stacktrace | ||
|
||
- name: Build debug apk | ||
run: bash ./gradlew assembleDebug | ||
|
||
- name: Upload debug apk | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: debug-apk | ||
path: app/build/outputs/apk/debug/*.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<lint> | ||
<!-- Disable the NotificationPermission check for glide --> | ||
<issue id="NotificationPermission"> | ||
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" /> | ||
</issue> | ||
|
||
<!-- Set the severity of missing translations to warning instead of error --> | ||
<issue id="MissingTranslation" severity="warning" /> | ||
<issue id="MissingQuantity" severity="warning" /> | ||
</lint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 18 additions & 7 deletions
25
...a/privacyfriendlyshoppinglist/secuso/org/privacyfriendlyshoppinglist/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import androidx.test.core.app.ApplicationProvider; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.platform.app.InstrumentationRegistry; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> | ||
{ | ||
public ApplicationTest() | ||
{ | ||
super(Application.class); | ||
@RunWith(AndroidJUnit4.class) | ||
public class ApplicationTest { | ||
@Test | ||
public void useApplicationContext() { | ||
assertEquals("privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist", ApplicationProvider.getApplicationContext().getPackageName()); | ||
} | ||
|
||
@Test | ||
public void useContext() { | ||
assertEquals("privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.test", InstrumentationRegistry.getInstrumentation().getContext().getPackageName()); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ivacyfriendlyshoppinglist/secuso/org/privacyfriendlyshoppinglist/MainActivityBasicTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist | ||
|
||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.ui.main.MainActivity | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class MainActivityBasicTest { | ||
@get: Rule | ||
var mActivityRule = ActivityScenarioRule(MainActivity::class.java) | ||
|
||
@Test | ||
fun launchActivity() { | ||
} | ||
|
||
@Test | ||
fun openDrawer() { | ||
onView(withContentDescription(R.string.navigation_drawer_open)).perform(click()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.