wormchain-icts.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: Wormchain's end-to-end Interchain Tests
  2. on:
  3. pull_request:
  4. push:
  5. tags:
  6. - "**"
  7. branches:
  8. - "main"
  9. permissions:
  10. contents: read
  11. env:
  12. GO_VERSION: 1.21
  13. TAR_PATH: /tmp/wormchain-docker-image.tar
  14. IMAGE_NAME: wormchain-docker-image
  15. concurrency:
  16. group: ${{ github.workflow }}-${{ github.ref }}
  17. cancel-in-progress: true
  18. jobs:
  19. build-docker:
  20. runs-on: ubuntu-latest
  21. permissions:
  22. packages: write
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@v4
  26. - name: Setup Go ${{ env.GO_VERSION }}
  27. uses: actions/setup-go@v4
  28. with:
  29. go-version: ${{ env.GO_VERSION }}
  30. cache-dependency-path: wormchain/interchaintest/go.sum
  31. - name: Set up Docker Buildx
  32. uses: docker/setup-buildx-action@v3
  33. - name: Build and export
  34. uses: docker/build-push-action@v5
  35. with:
  36. context: .
  37. file: wormchain/Dockerfile.ict
  38. tags: wormchain:local
  39. outputs: type=docker,dest=${{ env.TAR_PATH }}
  40. - name: Upload artifact
  41. uses: actions/upload-artifact@v4
  42. with:
  43. name: ${{ env.IMAGE_NAME }}
  44. path: ${{ env.TAR_PATH }}
  45. e2e-tests:
  46. needs: build-docker
  47. runs-on: ubuntu-latest
  48. strategy:
  49. matrix:
  50. # names of `make` commands to run tests
  51. test:
  52. - "ictest-cancel-upgrade"
  53. - "ictest-slashing-params-update-vaa"
  54. - "ictest-upgrade"
  55. - "ictest-wormchain"
  56. # Disabled due to flakiness in CI.
  57. # - "ictest-ibc-receiver"
  58. - "ictest-validator-hotswap"
  59. - "ictest-cw-wormhole"
  60. - "ictest-cw-shutdown-contracts"
  61. fail-fast: false
  62. steps:
  63. - name: Set up Go ${{ env.GO_VERSION }}
  64. uses: actions/setup-go@v4
  65. with:
  66. go-version: ${{ env.GO_VERSION }}
  67. cache-dependency-path: interchaintest/go.sum
  68. - name: checkout chain
  69. uses: actions/checkout@v4
  70. - name: Download Tarball Artifact
  71. uses: actions/download-artifact@v4
  72. with:
  73. name: ${{ env.IMAGE_NAME }}
  74. path: /tmp
  75. - name: Load Docker Image
  76. run: |
  77. docker image load -i ${{ env.TAR_PATH }}
  78. docker image ls -a
  79. - name: Run Test
  80. id: run_test
  81. continue-on-error: true
  82. working-directory: wormchain
  83. run: make ${{ matrix.test }}
  84. - name: Retry Failed Test
  85. if: steps.run_test.outcome == 'failure'
  86. working-directory: wormchain
  87. run: |
  88. for i in 1 2; do
  89. echo "Retry attempt $i"
  90. if make ${{ matrix.test }}; then
  91. echo "Test passed on retry"
  92. exit 0
  93. fi
  94. done
  95. echo "Test failed after retries"
  96. exit 1