diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 3c95811..3166ccb 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,13 +14,25 @@ jobs: java_version: name: Use Java runs-on: ubuntu-latest - if: contains(github.event.head_commit.message, 'Update') + # Runs only when commit message startsWith 'Update' + if: startsWith(github.event.head_commit.message, 'Update') steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4.2.1 + with: + java-version: 17 + # Print Hello, world! - name: Run a one-line script run: echo Hello, world! + # Print Java compiler version - name: Print Java - run: javac -version \ No newline at end of file + run: javac -version + + - name: Run Debug Tests + run: ./gradlew :app:testDebugUnitTest \ No newline at end of file diff --git a/app/src/test/java/com/asemlab/samples/ExampleUnitTest.kt b/app/src/test/java/com/asemlab/samples/ExampleUnitTest.kt index 9bbd702..00d36eb 100644 --- a/app/src/test/java/com/asemlab/samples/ExampleUnitTest.kt +++ b/app/src/test/java/com/asemlab/samples/ExampleUnitTest.kt @@ -12,6 +12,6 @@ import org.junit.Assert.* class ExampleUnitTest { @Test fun addition_isCorrect() { - assertEquals(4, 2 + 2) + assertEquals(5, 2 + 2) } } \ No newline at end of file