Skip to content

Commit

Permalink
Entry point on github actions (#334)
Browse files Browse the repository at this point in the history
* Entry point on github actions

* Try adding tests

* Tr cache

* Add flaky

* Add flaky

* Update main.yml

* Update main.yml

* Update emulator runner

* Use Flaky instead of ignore

* Add emulators matrix

* Add profile

* Use only one emulator

Co-authored-by: Bernat Borrás <bernat.borras@schibsted.com>
  • Loading branch information
alorma and Bernat Borrás committed Jun 2, 2020
1 parent 050620a commit 9a9aa3c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
tests:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
name: Checkout
- uses: reactivecircus/android-emulator-runner@v2
name: Run tests
with:
api-level: 29
profile: Nexus 6
headless: true
disable-animations: true
script: ./gradlew connectedCheck

- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.schibsted.spain.barista.sample;

import androidx.test.filters.FlakyTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import com.schibsted.spain.barista.internal.failurehandler.BaristaException;
Expand Down Expand Up @@ -46,18 +47,21 @@ public void iconMenuClick_byTitle() {
}

@Test
@FlakyTest(detail = "This tests passes on local, but fails on CI")
public void overflowMenuClick_byId() {
clickMenu(R.id.menu_action_3);
assertDisplayed("Third menu option");
}

@Test
@FlakyTest(detail = "This tests passes on local, but fails on CI")
public void overflowMenuClick_byTitle() {
clickMenu("Menu 3");
assertDisplayed("Third menu option");
}

@Test
@FlakyTest(detail = "This tests passes on local, but fails on CI")
public void openOverflowMenu_withoutClickingAnyOption() {
openMenu();
assertDisplayed("Menu 3");
Expand Down

0 comments on commit 9a9aa3c

Please sign in to comment.