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

Init ci and tests #1

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

*Note: Please write your issue only in english*

**Description**
A clear and concise description of what the bug is.

**Steps to reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
- Device: [e.g. Samsung S20 Ultra 5G]
- Android version: [e.g. Android 11]
- App version: [e.g. 4.0.1]

**Additional context**
Add any other context about the problem here.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

*Note: Please write your issue only in english*

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Author Assign

on:
pull_request_target:
types: [ opened, reopened ]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
28 changes: 28 additions & 0 deletions .github/workflows/dependent-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dependent Issues

on:
issues:
types:
- opened
- edited
- closed
- reopened
pull_request_target:
types:
- opened
- edited
- closed
- reopened
# Makes sure we always add status check for PRs. Useful only if
# this action is required to pass before merging. Otherwise, it
# can be removed.
- synchronize

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: z0al/[email protected]
env:
# (Required) The token to use to make API calls to GitHub.
GITHUB_TOKEN: ${{ github.token }}
41 changes: 41 additions & 0 deletions .github/workflows/multiplatform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Multiplatform CI

on:
pull_request:

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:

instrumentation-tests:
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Android ]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout the code
uses: actions/[email protected]
with:
token: ${{ github.token }}
submodules: recursive

# Setup Gradle and run Build
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
./gradlew clean
./gradlew :Common:build
./gradlew :Core:build
./gradlew :DB:build
./gradlew :Network:build

# Run tests
- name: Run Unit tests
run: ./gradlew allTests --stacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class AndroidGreetingTest {

@Test
fun testExample() {
assertTrue("Check Android is mentioned", Greeting().greet().contains("Android"))
assertTrue("Check platform is android", getPlatform().name.contains("Android"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.common

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class CommonGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("Hello"), "Check 'Hello' is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.common

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class IosGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("iOS"), "Check iOS is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class AndroidGreetingTest {

@Test
fun testExample() {
assertTrue("Check Android is mentioned", Greeting().greet().contains("Android"))
assertTrue("Check platform is android", getPlatform().name.contains("Android"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class CommonGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("Hello"), "Check 'Hello' is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class IosGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("iOS"), "Check iOS is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class AndroidGreetingTest {

@Test
fun testExample() {
assertTrue("Check Android is mentioned", Greeting().greet().contains("Android"))
assertTrue("Check platform is android", getPlatform().name.contains("Android"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.db

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class CommonGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("Hello"), "Check 'Hello' is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.db

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class IosGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("iOS"), "Check iOS is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class AndroidGreetingTest {

@Test
fun testExample() {
assertTrue("Check Android is mentioned", Greeting().greet().contains("Android"))
assertTrue("Check platform is android", getPlatform().name.contains("Android"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.network

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class CommonGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("Hello"), "Check 'Hello' is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package com.infomaniak.multiplatform_swisstransfer.network

import kotlin.test.Test
import kotlin.test.assertTrue
import kotlin.test.assertEquals

class IosGreetingTest {

@Test
fun testExample() {
assertTrue(Greeting().greet().contains("iOS"), "Check iOS is mentioned")
assertEquals(4, 2 + 2, "Check for correct addition")
}
}
Loading