name: Run test cases

on:
    push:
    pull_request:
    release:
        types:
            - published
            - prereleased

jobs:
    run_test_case:
        runs-on: ubuntu-latest

        container:
            image: golang:1.13

        steps:
        - uses: actions/checkout@v2
        - name: install lib
          run: apt-get update && apt-get install libzmq3-dev -y
        - name: run test case
          run: |
            mkdir -p data
            go build --buildmode=plugin -o plugins/sources/Random@v1.0.0.so plugins/sources/random.go
            go build --buildmode=plugin -o plugins/sinks/File@v1.0.0.so plugins/sinks/file.go
            go build --buildmode=plugin -o plugins/functions/Echo.so plugins/functions/echo.go
            go build --buildmode=plugin -o plugins/functions/CountPlusOne@v1.0.0.so plugins/functions/countPlusOne.go
            go test ./...
            go test --tags=edgex ./...
    