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.

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