run-network-tests-push.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: run-network-tests-branch
  2. on:
  3. push:
  4. workflow_dispatch:
  5. jobs:
  6. prepare_docker_images:
  7. name: Build new images
  8. runs-on: ubuntu-latest
  9. outputs:
  10. joystream_node_tag: ${{ steps.docker_build.outputs.tag }}
  11. steps:
  12. - uses: actions/checkout@v1
  13. - name: Login to DockerHub
  14. uses: docker/login-action@v1
  15. with:
  16. username: ${{ secrets.DOCKERHUB_USERNAME }}
  17. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  18. # TODO: Try to not build a new image: compute a hash over rust code and use that as the docker
  19. # image tag. (Normally this would be the git repo commit hash but the monorepo contains multiple projects
  20. # that is why it is not effective.)
  21. - id: docker_build
  22. name: Build and publish docker images
  23. run: |
  24. docker-compose build
  25. export JOYSTREAM_NODE_TAG=`docker run joystream/node --version | sed -e 's/^joystream-node //' | tr -d '\n' | tr -d '\r'`
  26. docker image tag joystream/node joystream/node:${JOYSTREAM_NODE_TAG}
  27. docker push joystream/node:${JOYSTREAM_NODE_TAG}
  28. echo "::set-output name=tag::${JOYSTREAM_NODE_TAG}"
  29. run_network_tests_1:
  30. name: Network Integration Runtime Tests
  31. needs: prepare_docker_images
  32. runs-on: ubuntu-latest
  33. env:
  34. JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
  35. steps:
  36. - uses: actions/checkout@v1
  37. - uses: actions/setup-node@v1
  38. with:
  39. node-version: '12.x'
  40. - name: Install packages and dependencies
  41. run: yarn install --frozen-lockfile
  42. - name: Ensure tests are runnable
  43. run: yarn workspace network-tests build
  44. - name: Pull joystream/node image from Dockerhub
  45. run: docker-compose pull
  46. - name: Start chain
  47. run: docker-compose up -d
  48. - name: Execute network tests
  49. run: yarn workspace network-tests test
  50. run_network_tests_2:
  51. name: Query Node Tests (Placeholder)
  52. needs: prepare_docker_images
  53. runs-on: ubuntu-latest
  54. env:
  55. JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
  56. steps:
  57. - uses: actions/checkout@v1
  58. - uses: actions/setup-node@v1
  59. with:
  60. node-version: '12.x'
  61. - name: Install packages and dependencies
  62. run: yarn install --frozen-lockfile
  63. - name: Ensure tests are runnable
  64. run: yarn workspace network-tests build
  65. - name: Pull joystream/node image from Dockerhub
  66. run: docker-compose pull
  67. - name: Start chain
  68. run: docker-compose up -d
  69. - name: Execute network tests
  70. run: yarn workspace network-tests test
  71. # These tests will fail because storage-node has not been updated for latest rutnime types
  72. # for babylon
  73. run_network_tests_3:
  74. name: Storage Node Tests
  75. needs: prepare_docker_images
  76. runs-on: ubuntu-latest
  77. env:
  78. JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
  79. steps:
  80. - uses: actions/checkout@v1
  81. - uses: actions/setup-node@v1
  82. with:
  83. node-version: '12.x'
  84. - name: Install packages and dependencies
  85. run: |
  86. yarn install --frozen-lockfile
  87. yarn workspace storage-node build
  88. - name: Build storage node
  89. run: yarn workspace storage-node build
  90. - name: Pull joystream/node image from Dockerhub
  91. run: docker-compose pull
  92. - name: Start chain
  93. run: docker-compose up -d
  94. - name: Execute tests
  95. run: DEBUG=* yarn storage-cli dev-init