name: unittests

on:
  push:
    branches: [ master ]
    tags:
      - '0.*'
  pull_request:
    branches: [ master ]
    
jobs:
  buildAndTest:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with: 
        submodules: recursive
    - name: Unit test
      uses: ./.github/actions/unit-test
    - name: listing test results
      run: ls out 
    - name: Upload unittests artifact
      uses: actions/upload-artifact@v2
      with:
        name: unittest
        path: ${{github.workspace}}/out
    - name: Publish Test Report
      uses: codecov/codecov-action@v2
      with:
        files: ${{github.workspace}}/out/all_targets.info
        flags: unittests # optional
        name: codecov-umbrella # optional
        fail_ci_if_error: true # optional (default = false)
        verbose: true # optional (default = false)
