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.

126 lines
3.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: 4
  23. steps:
  24. - uses: actions/checkout@v2
  25. - uses: technote-space/get-diff-action@v1
  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. # Cache bin
  40. - uses: actions/cache@v1
  41. with:
  42. path: ~/go/bin
  43. key: ${{ runner.os }}-go-tm-binary
  44. if: "env.GIT_DIFF != ''"
  45. test_abci_apps:
  46. runs-on: ubuntu-latest
  47. needs: Build
  48. timeout-minutes: 4
  49. steps:
  50. - uses: actions/checkout@v2
  51. - uses: technote-space/get-diff-action@v1
  52. with:
  53. SUFFIX_FILTER: |
  54. .go
  55. .mod
  56. .sum
  57. SET_ENV_NAME_INSERTIONS: 1
  58. SET_ENV_NAME_LINES: 1
  59. - name: Set GOBIN
  60. run: |
  61. echo "::add-path::$(go env GOPATH)/bin"
  62. - uses: actions/cache@v1
  63. with:
  64. path: ~/go/bin
  65. key: ${{ runner.os }}-go-tm-binary
  66. if: "env.GIT_DIFF != ''"
  67. - name: test_abci_apps
  68. run: abci/tests/test_app/test.sh
  69. shell: bash
  70. if: "env.GIT_DIFF != ''"
  71. test_abci_cli:
  72. runs-on: ubuntu-latest
  73. needs: Build
  74. timeout-minutes: 4
  75. steps:
  76. - uses: actions/checkout@v2
  77. - uses: technote-space/get-diff-action@v1
  78. with:
  79. SUFFIX_FILTER: |
  80. .go
  81. .mod
  82. .sum
  83. SET_ENV_NAME_INSERTIONS: 1
  84. SET_ENV_NAME_LINES: 1
  85. - name: Set GOBIN
  86. run: |
  87. echo "::add-path::$(go env GOPATH)/bin"
  88. - uses: actions/cache@v1
  89. with:
  90. path: ~/go/bin
  91. key: ${{ runner.os }}-go-tm-binary
  92. if: "env.GIT_DIFF != ''"
  93. - run: abci/tests/test_cli/test.sh
  94. shell: bash
  95. if: "env.GIT_DIFF != ''"
  96. test_apps:
  97. runs-on: ubuntu-latest
  98. needs: Build
  99. timeout-minutes: 4
  100. steps:
  101. - uses: actions/checkout@v2
  102. - uses: technote-space/get-diff-action@v1
  103. with:
  104. SUFFIX_FILTER: |
  105. .go
  106. .mod
  107. .sum
  108. SET_ENV_NAME_INSERTIONS: 1
  109. SET_ENV_NAME_LINES: 1
  110. - name: Set GOBIN
  111. run: |
  112. echo "::add-path::$(go env GOPATH)/bin"
  113. - uses: actions/cache@v1
  114. with:
  115. path: ~/go/bin
  116. key: ${{ runner.os }}-go-tm-binary
  117. if: "env.GIT_DIFF != ''"
  118. - name: test_apps
  119. run: test/app/test.sh
  120. shell: bash
  121. if: "env.GIT_DIFF != ''"