From 465ad2b066470fc15b6f20312cffc18b9248a8df Mon Sep 17 00:00:00 2001 From: Alex Osinniy Date: Thu, 31 Dec 2020 07:05:15 +0200 Subject: [PATCH 1/2] Create ci.yml --- .github/workflows/ci.yml | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..583b2c1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,97 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + workflow_dispatch: + + +jobs: + build: + name: Build/Check + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.gradle/caches/ + key: build-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + + - name: Build/Check + run: ./gradlew build check --continue --warning-mode all + + + unit-tests: + name: Unit Tests + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.gradle/caches/ + key: unit-tests-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + + - name: Unit Tests + run: ./gradlew testDebugUnitTest --warning-mode all + + + instrumentation-tests: + name: Instrumentation Tests + runs-on: macOS-latest + timeout-minutes: 60 + strategy: + fail-fast: true + matrix: + api-level: [21, 23, 25, 27, 29] + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: instrumentation-tests-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + + - name: Instrumentation Tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + arch: x86 + script: ./gradlew connectedDebugAndroidTest --warning-mode all From d0d6c01f6ab4e11dc2cc979449b9e36031077c8d Mon Sep 17 00:00:00 2001 From: Alex Osinniy Date: Thu, 31 Dec 2020 07:14:17 +0200 Subject: [PATCH 2/2] Add 'bash' before ./gradlew --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 583b2c1..a10782e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: key: build-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - name: Build/Check - run: ./gradlew build check --continue --warning-mode all + run: bash ./gradlew build check --continue --warning-mode all unit-tests: @@ -60,7 +60,7 @@ jobs: key: unit-tests-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - name: Unit Tests - run: ./gradlew testDebugUnitTest --warning-mode all + run: bash ./gradlew testDebugUnitTest --warning-mode all instrumentation-tests: @@ -94,4 +94,4 @@ jobs: with: api-level: ${{ matrix.api-level }} arch: x86 - script: ./gradlew connectedDebugAndroidTest --warning-mode all + script: bash ./gradlew connectedDebugAndroidTest --warning-mode all