github.com/instill-ai/component@v0.16.0-beta/.github/workflows/coverage.yml (about)

     1  name: Coverage
     2  
     3  on: [push, pull_request]
     4  
     5  jobs:
     6    codecov:
     7      name: codecov
     8      runs-on: ubuntu-latest
     9      permissions:
    10        contents: read
    11        pull-requests: write
    12      steps:
    13        - name: Install operator dependencies
    14          run: sudo apt-get update -y && sudo apt-get install poppler-utils wv unrtf tidy tesseract-ocr libtesseract-dev -y
    15  
    16        - uses: actions/checkout@v3
    17          with:
    18            token: ${{ secrets.GITHUB_TOKEN }}
    19  
    20        - name: Load .env file
    21          uses: cardinalby/export-env-action@v2
    22          with:
    23            envFile: .env
    24            expand: true
    25  
    26        - uses: actions/setup-go@v3
    27          with:
    28            go-version: ${{ env.GOLANG_VERSION }}
    29  
    30        - uses: actions/checkout@v3
    31  
    32        - name: Generate coverage report
    33          run: |
    34            go mod tidy
    35            go test -tags ocr -race ./... -coverprofile=coverage.txt -covermode=atomic
    36  
    37        - name: Upload coverage report
    38          uses: codecov/codecov-action@v2
    39          with:
    40            file: ./coverage.txt
    41            flags: unittests
    42            name: codecov-umbrella