ci.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: CI
  2. on: push
  3. jobs:
  4. test:
  5. name: Go ${{ matrix.go-version }} with Kafka ${{ matrix.kafka-version }} on Ubuntu
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. go-version: [1.12.x, 1.13.x]
  11. kafka-version: [2.2.2, 2.3.1, 2.4.0]
  12. platform: [ubuntu-latest]
  13. env:
  14. KAFKA_PEERS: localhost:9091,localhost:9092,localhost:9093,localhost:9094,localhost:9095
  15. TOXIPROXY_ADDR: http://localhost:8474
  16. KAFKA_INSTALL_ROOT: /home/runner/kafka
  17. KAFKA_HOSTNAME: localhost
  18. DEBUG: true
  19. KAFKA_VERSION: ${{ matrix.kafka-version }}
  20. KAFKA_SCALA_VERSION: 2.12
  21. steps:
  22. - uses: actions/checkout@v1
  23. - name: Setup Go
  24. uses: actions/setup-go@v1
  25. with:
  26. go-version: ${{ matrix.go-version }}
  27. - uses: actions/cache@v1
  28. with:
  29. path: ~/go/pkg/mod
  30. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  31. restore-keys: |
  32. ${{ runner.os }}-go-
  33. # See https://github.com/actions/setup-go/issues/14
  34. - name: Setup env
  35. run: |
  36. echo "::set-env name=GOPATH::$(go env GOPATH)"
  37. echo "::add-path::$(go env GOPATH)/bin"
  38. shell: bash
  39. - name: Install dependencies
  40. run: |
  41. curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1
  42. export REPOSITORY_ROOT=${GITHUB_WORKSPACE}
  43. vagrant/install_cluster.sh
  44. vagrant/boot_cluster.sh
  45. vagrant/create_topics.sh
  46. vagrant/run_java_producer.sh
  47. - name: Run test suite
  48. run: make test
  49. - name: Run linter
  50. run: make lint
  51. - name: Teardown
  52. run: vagrant/halt_cluster.sh