Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run my unit tests in github action workflow?

So I developed a few tests for my Android app and I need to run the tests using github actions workflow. Here is my .yml file, but I don't know how to run the tests( and get their logs):

name: Java CI with Gradle

on:
  push:
  pull_request:
    branches: Features

jobs:
  test:
    name: Run Unit Tests
    runs-on: ubuntu-18.04

    steps:
      - uses: actions/checkout@v1
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Unit tests
        run: bash ./gradlew test --stacktrace
      - name: Unit tests results
        uses: actions/upload-artifact@v1
        with:
          name: unit-tests-results
          path: ./app

I'm not sure how to run all the app and then run all the tests, can someone give me a hint? I searched all the internet, I came across this code, but it doesn't work. My artifact is the whole app itself The tests are:
1.SignUpTest.java
2.SignInTest.java
3.AddToCart.java

like image 325
Andrei Manolache Avatar asked Nov 06 '22 07:11

Andrei Manolache


1 Answers

The Android starter workflow should fit your needs.

like image 156
Ryan Payne Avatar answered Nov 09 '22 13:11

Ryan Payne