Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running CI via GitHub actions #21

Merged
merged 6 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .circleci/config.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/gradle-dependency-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Gradle Dependency Submission

on:
push:
branches: [ "main" ]

jobs:
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v4
43 changes: 43 additions & 0 deletions .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Gradle Build and Tests

on:
push:
branches: [ "main" ]
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Adding Google Services
env:
DATA: ${{ secrets.GOOGLE_SERVICES }}
run: echo $DATA | base64 -di > ./example/google-services.json

- name: Build with Gradle Wrapper
run: ./gradlew build -x lint

- name: Test with Gradle Wrapper
run: ./gradlew test

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test*/TEST-*.xml'
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.NewNotification("NewNotification"))

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
storePage.edges.mapIndexed { index, edge ->
store[index].id.shouldBe(edge.node.id)
Expand All @@ -160,7 +160,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.ReadNotification(chosenIndex.toString()))

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount)
Expand All @@ -185,7 +185,7 @@ internal class NotificationStoreRealTimeTests {

// THEN
store[chosenIndex].readAt.shouldNotBeNull()
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount - 1)
Expand All @@ -211,7 +211,7 @@ internal class NotificationStoreRealTimeTests {
// THEN
store[chosenIndex].readAt.shouldNotBeNull()
store[chosenIndex].seenAt.shouldNotBeNull()
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount - 1)
Expand All @@ -235,7 +235,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.ReadNotification("Not exists"))

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
storePage.edges.mapIndexed { index, edge ->
Expand All @@ -262,7 +262,7 @@ internal class NotificationStoreRealTimeTests {

// THEN
store[chosenIndex].readAt.shouldBeNull()
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount + 1)
Expand All @@ -288,7 +288,7 @@ internal class NotificationStoreRealTimeTests {

// THEN
store[chosenIndex].readAt.shouldBeNull()
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount)
Expand All @@ -311,7 +311,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.UnreadNotification("Not exists"))

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
Unit
}
Expand All @@ -334,7 +334,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.DeleteNotification(chosenIndex.toString()))

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.totalCount.shouldBeExactly(initialCounter.totalCount - 1)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount - 1)
store.forEach { notification ->
Expand All @@ -359,7 +359,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.DeleteNotification(chosenIndex.toString()))

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.unseenCount.shouldBeExactly(initialCounter.unseenCount - 1)
Unit
}
Expand All @@ -381,7 +381,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.DeleteNotification(chosenIndex.toString()))

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.unseenCount.shouldBeExactly(initialCounter.unseenCount)
Unit
}
Expand All @@ -402,7 +402,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.DeleteNotification("Not exists"))

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.totalCount.shouldBeExactly(initialCounter.totalCount)
store.unreadCount.shouldBeExactly(initialCounter.unreadCount)
store.unseenCount.shouldBeExactly(initialCounter.unseenCount)
Expand All @@ -424,7 +424,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.ReadAllNotification)

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.forEach { notification ->
notification.readAt.shouldNotBeNull()
Expand All @@ -446,7 +446,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.SeenAllNotification)

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.forEach { notification ->
notification.seenAt.shouldNotBeNull()
Expand Down Expand Up @@ -977,7 +977,7 @@ internal class NotificationStoreRealTimeTests {
)

// THEN
coVerify(exactly = 1) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 1, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize - 1)
store.totalCount.shouldBeExactly(initialCounter.totalCount - 1)
Unit
Expand Down
Loading