Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
trOnk12 committed Oct 6, 2023
1 parent 8a1bb30 commit 0efa7c4
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 45 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/run-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run code coverage

on:
pull_request:
push:
branches:
- "develop"
- "main"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Execute unit tests
- name: Unit Test with Android Emulator Runner
uses: ReactiveCircus/[email protected]
with:
api-level: 29
script: ./gradlew connectedCheck

# run: ./gradlew testDebugUnitTest

- name: generate report
uses: actions/upload-artifact@v2
with:
name: report
path: app/build/reports/coverage/debug
90 changes: 45 additions & 45 deletions .github/workflows/run-unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
name: Run unit tests

on:
pull_request:
push:
branches:
- "develop"
- "main"

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

permissions: read-all

jobs:
unit-tests:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unit Test with Android Emulator Runner
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedCheck

env:
GITHUB_USER: ${{ github.actor }}

- name: Upload report
uses: actions/upload-artifact@v2
with:
name: report
path: app/build/reports/coverage/androidTest/debug

- name: Include Slack Notification
if: failure() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
uses: ./.github/actions/slack-notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_GIT_REF: ${{ github.ref }}
SLACK_WORKFLOW: ${{ github.workflow }}
#name: Run unit tests
#
#on:
# pull_request:
# push:
# branches:
# - "develop"
# - "main"
#
#concurrency:
# group: ${{ github.ref }}-${{ github.workflow }}
# cancel-in-progress: true
#
#permissions: read-all
#
#jobs:
# unit-tests:
# runs-on: macos-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Unit Test with Android Emulator Runner
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# script: ./gradlew connectedCheck
#
# env:
# GITHUB_USER: ${{ github.actor }}
#
# - name: Upload report
# uses: actions/upload-artifact@v2
# with:
# name: report
# path: app/build/reports/coverage/androidTest/debug
#
# - name: Include Slack Notification
# if: failure() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
# uses: ./.github/actions/slack-notification
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_GIT_REF: ${{ github.ref }}
# SLACK_WORKFLOW: ${{ github.workflow }}

0 comments on commit 0efa7c4

Please sign in to comment.