name: Run Test

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

jobs:
  build_and_test:
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout the repo
      uses: actions/checkout@v4

    - name: Build base image
      run: script -e -c "./app.sh build base test"

    - name: Build emulator image and run unit-test
      run: script -e -c "./app.sh test emulator test 11.0 && sudo mv tmp/* ."

    - name: Publish test result
      run: bash <(curl -s https://codecov.io/bash)
