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.

106 lines
2.8 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@v5
  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_cli:
  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@v5
  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. - run: abci/tests/test_cli/test.sh
  71. shell: bash
  72. if: env.GIT_DIFF
  73. test_apps:
  74. runs-on: ubuntu-latest
  75. needs: build
  76. timeout-minutes: 5
  77. steps:
  78. - uses: actions/setup-go@v2
  79. with:
  80. go-version: "1.16"
  81. - uses: actions/checkout@v2.3.4
  82. - uses: technote-space/get-diff-action@v5
  83. with:
  84. PATTERNS: |
  85. **/**.go
  86. go.mod
  87. go.sum
  88. - uses: actions/cache@v2.1.6
  89. with:
  90. path: ~/go/pkg/mod
  91. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  92. restore-keys: |
  93. ${{ runner.os }}-go-
  94. if: env.GIT_DIFF
  95. - uses: actions/cache@v2.1.6
  96. with:
  97. path: ~/go/bin
  98. key: ${{ runner.os }}-${{ github.sha }}-tm-binary
  99. if: env.GIT_DIFF
  100. - name: test_apps
  101. run: test/app/test.sh
  102. shell: bash
  103. if: env.GIT_DIFF