run_test_case.yaml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Run test cases
  2. concurrency:
  3. group: test-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. tags:
  8. - "*"
  9. pull_request:
  10. release:
  11. types:
  12. - published
  13. jobs:
  14. run_test_case:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. - uses: actions/setup-go@v3
  19. with:
  20. go-version: '1.18'
  21. - uses: actions/setup-python@v4
  22. with:
  23. python-version: '3.x'
  24. architecture: 'x64'
  25. - run: pip3 install pynng
  26. - name: run code static check
  27. run : |
  28. if [ ! -z "$(gofmt -l .)" ];then
  29. echo "code static check error"
  30. gofmt -l .
  31. exit 1
  32. fi
  33. - name: install lib
  34. run: sudo apt-get update && sudo apt-get install libzmq3-dev -y
  35. - name: run test case
  36. run: |
  37. curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash && source $HOME/.wasmedge/env
  38. mkdir -p plugins/wasm
  39. set -e -u -x
  40. mkdir -p data
  41. mkdir -p log
  42. sed -i -r "s/debug: .*/debug: true/1" etc/kuiper.yaml
  43. go build --buildmode=plugin -o plugins/sources/Random@v2.0.0.so extensions/sources/random/random.go
  44. cp extensions/sources/random/random.yaml etc/sources/random.yaml
  45. go build --buildmode=plugin -o plugins/sinks/File@v1.0.0.so extensions/sinks/file/file.go
  46. go build --buildmode=plugin -o plugins/functions/Echo.so extensions/functions/echo/echo.go
  47. go build --buildmode=plugin -o plugins/functions/CountPlusOne@v1.0.0.so extensions/functions/countPlusOne/countPlusOne.go
  48. go build --buildmode=plugin -o plugins/functions/AccumulateWordCount@v1.0.0.so extensions/functions/accumulateWordCount/accumulateWordCount.go
  49. go build --buildmode=plugin -o data/test/helloworld.so internal/converter/protobuf/test/*.go
  50. go build --buildmode=plugin -o data/test/myFormat.so internal/converter/custom/test/*.go
  51. mkdir -p plugins/portable/mirror
  52. cd sdk/go/example/mirror
  53. go build -o ../../../../plugins/portable/mirror/mirror .
  54. cp mirror.json ../../../../plugins/portable/mirror
  55. cd ../../../../
  56. cp -r sdk/python/example/pysam plugins/portable/pysam
  57. cp -r sdk/python/ekuiper plugins/portable/pysam/
  58. go test --tags="edgex script test" ./...
  59. - name: run plugins test case
  60. run: |
  61. mkdir -p data/test/uploads
  62. cp extensions/functions/dependencies/tensorflow/models/* data/test/uploads/
  63. export CGO_CFLAGS=-I$(pwd)/extensions/functions/dependencies/tensorflow
  64. export CGO_LDFLAGS=-L$(pwd)/extensions/functions/dependencies/tensorflow/amd64
  65. export LD_LIBRARY_PATH=$(pwd)/extensions/functions/dependencies/tensorflow/amd64:$LD_LIBRARY_PATH
  66. cd extensions
  67. go test ./functions/...
  68. - uses: actions/upload-artifact@v3
  69. if: failure()
  70. with:
  71. name: stream.log
  72. path: log/stream.log