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.

138 lines
3.6 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. build:
  13. name: Build
  14. runs-on: ubuntu-latest
  15. timeout-minutes: 5
  16. steps:
  17. - uses: actions/setup-go@v2
  18. with:
  19. go-version: "1.16"
  20. - uses: actions/checkout@v2.3.4
  21. - uses: technote-space/get-diff-action@v4
  22. with:
  23. PATTERNS: |
  24. **/**.go
  25. go.mod
  26. go.sum
  27. - name: install
  28. run: make install install_abci
  29. if: "env.GIT_DIFF != ''"
  30. - uses: actions/cache@v2.1.6
  31. with:
  32. path: ~/go/pkg/mod
  33. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  34. restore-keys: |
  35. ${{ runner.os }}-go-
  36. if: env.GIT_DIFF
  37. # Cache binaries for use by other jobs
  38. - uses: actions/cache@v2.1.6
  39. with:
  40. path: ~/go/bin
  41. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  42. if: env.GIT_DIFF
  43. test_abci_apps:
  44. runs-on: ubuntu-latest
  45. needs: build
  46. timeout-minutes: 5
  47. steps:
  48. - uses: actions/setup-go@v2
  49. with:
  50. go-version: "1.16"
  51. - uses: actions/checkout@v2.3.4
  52. - uses: technote-space/get-diff-action@v4
  53. with:
  54. PATTERNS: |
  55. **/**.go
  56. go.mod
  57. go.sum
  58. - uses: actions/cache@v2.1.6
  59. with:
  60. path: ~/go/pkg/mod
  61. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  62. restore-keys: |
  63. ${{ runner.os }}-go-
  64. if: env.GIT_DIFF
  65. - uses: actions/cache@v2.1.6
  66. with:
  67. path: ~/go/bin
  68. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  69. if: env.GIT_DIFF
  70. - name: test_abci_apps
  71. run: abci/tests/test_app/test.sh
  72. shell: bash
  73. if: env.GIT_DIFF
  74. test_abci_cli:
  75. runs-on: ubuntu-latest
  76. needs: build
  77. timeout-minutes: 5
  78. steps:
  79. - uses: actions/setup-go@v2
  80. with:
  81. go-version: "1.16"
  82. - uses: actions/checkout@v2.3.4
  83. - uses: technote-space/get-diff-action@v4
  84. with:
  85. PATTERNS: |
  86. **/**.go
  87. go.mod
  88. go.sum
  89. - uses: actions/cache@v2.1.6
  90. with:
  91. path: ~/go/pkg/mod
  92. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  93. restore-keys: |
  94. ${{ runner.os }}-go-
  95. if: env.GIT_DIFF
  96. - uses: actions/cache@v2.1.6
  97. with:
  98. path: ~/go/bin
  99. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  100. if: env.GIT_DIFF
  101. - run: abci/tests/test_cli/test.sh
  102. shell: bash
  103. if: env.GIT_DIFF
  104. test_apps:
  105. runs-on: ubuntu-latest
  106. needs: build
  107. timeout-minutes: 5
  108. steps:
  109. - uses: actions/setup-go@v2
  110. with:
  111. go-version: "1.16"
  112. - uses: actions/checkout@v2.3.4
  113. - uses: technote-space/get-diff-action@v4
  114. with:
  115. PATTERNS: |
  116. **/**.go
  117. go.mod
  118. go.sum
  119. - uses: actions/cache@v2.1.6
  120. with:
  121. path: ~/go/pkg/mod
  122. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  123. restore-keys: |
  124. ${{ runner.os }}-go-
  125. if: env.GIT_DIFF
  126. - uses: actions/cache@v2.1.6
  127. with:
  128. path: ~/go/bin
  129. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  130. if: env.GIT_DIFF
  131. - name: test_apps
  132. run: test/app/test.sh
  133. shell: bash
  134. if: env.GIT_DIFF