You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.3 KiB

  1. name: Tests
  2. # Tests runs different tests (test_abci_apps, test_abci_cli, test_apps)
  3. # This workflow runs on every push to master or release branch and every pull requests
  4. # All jobs will pass without running if no *{.go, .mod, .sum} files have been modified
  5. on:
  6. pull_request:
  7. push:
  8. branches:
  9. - master
  10. - release/**
  11. jobs:
  12. cleanup-runs:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: rokroskar/workflow-run-cleanup-action@master
  16. env:
  17. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  18. if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
  19. build:
  20. name: Build
  21. runs-on: ubuntu-latest
  22. timeout-minutes: 5
  23. steps:
  24. - uses: actions/checkout@v2
  25. - uses: technote-space/get-diff-action@v3
  26. with:
  27. SUFFIX_FILTER: |
  28. .go
  29. .mod
  30. .sum
  31. SET_ENV_NAME_INSERTIONS: 1
  32. SET_ENV_NAME_LINES: 1
  33. - name: Set GOBIN
  34. run: |
  35. echo "::add-path::$(go env GOPATH)/bin"
  36. - name: install
  37. run: make install install_abci
  38. if: "env.GIT_DIFF != ''"
  39. - uses: actions/cache@v2.1.1
  40. with:
  41. path: ~/go/pkg/mod
  42. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  43. restore-keys: |
  44. ${{ runner.os }}-go-
  45. if: "env.GIT_DIFF != ''"
  46. # Cache binaries for use by other jobs
  47. - uses: actions/cache@v2.1.1
  48. with:
  49. path: ~/go/bin
  50. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  51. if: "env.GIT_DIFF != ''"
  52. test_abci_apps:
  53. runs-on: ubuntu-latest
  54. needs: Build
  55. timeout-minutes: 5
  56. steps:
  57. - uses: actions/checkout@v2
  58. - uses: technote-space/get-diff-action@v3
  59. with:
  60. SUFFIX_FILTER: |
  61. .go
  62. .mod
  63. .sum
  64. SET_ENV_NAME_INSERTIONS: 1
  65. SET_ENV_NAME_LINES: 1
  66. - name: Set GOBIN
  67. run: |
  68. echo "::add-path::$(go env GOPATH)/bin"
  69. - uses: actions/cache@v2.1.1
  70. with:
  71. path: ~/go/pkg/mod
  72. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  73. restore-keys: |
  74. ${{ runner.os }}-go-
  75. if: "env.GIT_DIFF != ''"
  76. - uses: actions/cache@v2.1.1
  77. with:
  78. path: ~/go/bin
  79. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  80. if: "env.GIT_DIFF != ''"
  81. - name: test_abci_apps
  82. run: abci/tests/test_app/test.sh
  83. shell: bash
  84. if: "env.GIT_DIFF != ''"
  85. test_abci_cli:
  86. runs-on: ubuntu-latest
  87. needs: Build
  88. timeout-minutes: 5
  89. steps:
  90. - uses: actions/checkout@v2
  91. - uses: technote-space/get-diff-action@v3
  92. with:
  93. SUFFIX_FILTER: |
  94. .go
  95. .mod
  96. .sum
  97. SET_ENV_NAME_INSERTIONS: 1
  98. SET_ENV_NAME_LINES: 1
  99. - name: Set GOBIN
  100. run: |
  101. echo "::add-path::$(go env GOPATH)/bin"
  102. - uses: actions/cache@v2.1.1
  103. with:
  104. path: ~/go/pkg/mod
  105. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  106. restore-keys: |
  107. ${{ runner.os }}-go-
  108. if: "env.GIT_DIFF != ''"
  109. - uses: actions/cache@v2.1.1
  110. with:
  111. path: ~/go/bin
  112. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  113. if: "env.GIT_DIFF != ''"
  114. - run: abci/tests/test_cli/test.sh
  115. shell: bash
  116. if: "env.GIT_DIFF != ''"
  117. test_apps:
  118. runs-on: ubuntu-latest
  119. needs: Build
  120. timeout-minutes: 5
  121. steps:
  122. - uses: actions/checkout@v2
  123. - uses: technote-space/get-diff-action@v3
  124. with:
  125. SUFFIX_FILTER: |
  126. .go
  127. .mod
  128. .sum
  129. SET_ENV_NAME_INSERTIONS: 1
  130. SET_ENV_NAME_LINES: 1
  131. - name: Set GOBIN
  132. run: |
  133. echo "::add-path::$(go env GOPATH)/bin"
  134. - uses: actions/cache@v2.1.1
  135. with:
  136. path: ~/go/pkg/mod
  137. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  138. restore-keys: |
  139. ${{ runner.os }}-go-
  140. if: "env.GIT_DIFF != ''"
  141. - uses: actions/cache@v2.1.1
  142. with:
  143. path: ~/go/bin
  144. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  145. if: "env.GIT_DIFF != ''"
  146. - name: test_apps
  147. run: test/app/test.sh
  148. shell: bash
  149. if: "env.GIT_DIFF != ''"