run-network-tests.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: run-network-tests
  2. on:
  3. pull_request:
  4. types: [labeled, synchronize]
  5. workflow_dispatch:
  6. jobs:
  7. run_network_tests:
  8. name: Network Integration Tests
  9. if: contains(github.event.pull_request.labels.*.name, 'run-network-tests') || github.event.action == null
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v1
  13. - uses: actions/setup-node@v1
  14. with:
  15. node-version: '12.x'
  16. - uses: technote-space/get-diff-action@v3
  17. with:
  18. PREFIX_FILTER: |
  19. node
  20. runtime-modules
  21. utils/chain-spec-builder
  22. SUFFIX_FILTER: |
  23. .rs
  24. FILES: |
  25. Cargo.lock
  26. Cargo.toml
  27. - name: Install packages and dependencies
  28. run: yarn install --frozen-lockfile
  29. - name: Ensure tests are runnable
  30. run: yarn workspace network-tests build
  31. - name: Maybe fetch pre-built joystream/node Docker image
  32. run: |
  33. # Always configure faster block production incase pull fails
  34. # and we will build from source.
  35. ./scripts/alter-block-creation-time.sh
  36. export JOYSTREAM_NODE_TAG="${{ pull.base.ref }}"
  37. echo "DEBUG: JOYSTREAM_NODE_TAG = ${JOYSTREAM_NODE_TAG}"
  38. if [ "${{ env.GIT_DIFF }}" ]
  39. then
  40. echo "joystream-node source modified. Will build from source."
  41. else
  42. # Try to get image tagged with base branch name. If it fails we continue anyway,
  43. # docker-compose will then bulid from srouce when it doesn't find the image.
  44. echo "joystream-node source not modified. Will try to use pre-built image"
  45. docker pull joystream/node:${JOYSTREAM_NODE_TAG}
  46. fi
  47. - name: Start chain
  48. run: JOYSTREAM_NODE_TAG=${{ pull.base.ref }} docker-compose up -d
  49. - name: Execute network tests
  50. run: yarn workspace network-tests test