test-coverage.yml 2.7 KB
Newer Older
B
BUG1989 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
name: test-coverage

on: [push, pull_request]

jobs:
  linux-gcc-x86:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: update
      run: sudo apt-get update
    - name: protobuf
      run: sudo apt-get install libopencv-dev
    - name: lcov
B
BUG1989 已提交
15
      run: sudo apt-get install lcov
B
BUG1989 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29
    - name: configure
      run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=debug -DTENGINE_BUILD_TESTS=ON -DTENGINE_COVERAGE=ON ..
    - name: build
      run: cmake --build build -j 2
    - name: models
      run: |
        cd build
        wget http://139.180.196.82/lite/models.zip
        unzip models.zip
        wget http://139.180.196.82/lite/x86_data.zip
        unzip x86_data.zip
        mv x86_data data
        wget http://139.180.196.82/lite/images.zip
        unzip images.zip
B
BUG1989 已提交
30
    - name: test-cpu
B
BUG1989 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43
      run: |
        cd build
        ../tests/test.sh
    - name: lcov-collect
      run: |
        cd build
        lcov -d ./src -c -o lcov.info
        lcov -r lcov.info '/usr/*' -o lcov.info
        lcov --list lcov.info
    - name: codecov
      uses: codecov/codecov-action@v1.0.11
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
B
BUG1989 已提交
44
        file: build/lcov.info
B
BUG1989 已提交
45

B
BUG1989 已提交
46

B
BUG1989 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
  linux-gcc-x86-timvx-simulator:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: update
      run: sudo apt-get update
    - name: protobuf
      run: sudo apt-get install libopencv-dev
    - name: lcov
      run: sudo apt-get install lcov
    - name: configure
      run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=debug -DTENGINE_ENABLE_TIM_VX=ON -DTENGINE_ENABLE_TIM_VX_INTEGRATION=ON -DTENGINE_COVERAGE=ON ..
    - name: build
      run: cmake --build build -j 2
    - name: models
      run: |
        cd build
        wget http://139.180.196.82/lite/images.zip
        unzip images.zip
        git clone https://github.com/BUG1989/tengine_test_data.git
    - name: test-timvx-simulator
      run: |
        cd build
        ./examples/tm_classification_timvx -m ./tengine_test_data/mobilenet_uint8.tmfile -i ./images/cat.jpg -g 224,224, -s 0.017,0.017,0.017
        ./examples/tm_classification_timvx -m ./tengine_test_data/squeezenet_uint8.tmfile -i ./images/cat.jpg -g 227,227, -s 0.017,0.017,0.017
    - name: lcov-collect
      run: |
        cd build
        lcov -d ./src -c -o lcov.info
        lcov -r lcov.info '*3rdparty*' -o lcov.info
        lcov -r lcov.info '*/src/dev/cpu/*' -o lcov.info
        lcov -r lcov.info '*/src/dev/tim-vx/src/*' -o lcov.info
        lcov -r lcov.info '/usr/*' -o lcov.info
        lcov --list lcov.info        
    - name: codecov
      uses: codecov/codecov-action@v1.0.11
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: build/lcov.info