123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- name: run-network-tests-pull-request
- on:
- pull_request:
- types: [labeled, synchronize]
- jobs:
- build_images:
- name: Prepare joystream/node docker image
- if: contains(github.event.pull_request.labels.*.name, 'run-network-tests')
- runs-on: ubuntu-latest
- outputs:
- use_artifact: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
- steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - uses: technote-space/get-diff-action@v3
- with:
- PREFIX_FILTER: |
- node
- runtime-modules
- utils/chain-spec-builder
- SUFFIX_FILTER: |
- .rs
- FILES: |
- Cargo.lock
- Cargo.toml
- # TODO: Look for change in source code but no corresponding version bump of runtime or binaries
- # - name: Check version modified correctly
- # if: env.GIT_DIFF
- - id: compute_shasum
- name: Compute runtime code shasum
- run: |
- export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
- echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
- - name: Check if we have a pre-built image in Artifacts
- continue-on-error: true
- uses: actions/download-artifact@v2
- with:
- name: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
- - name: Check if we have pre-built image on Dockerhub
- continue-on-error: true
- run: |
- if ! [ -f joystream-node-docker-image.tar.gz ]; then
- export JOYSTREAM_NODE_TAG=${{ steps.compute_shasum.outputs.shasum }}
- docker pull joystream/node:${JOYSTREAM_NODE_TAG}
- docker image tag joystream/node:${JOYSTREAM_NODE_TAG} joystream/node:latest
- docker save --output joystream-node-docker-image.tar joystream/node:latest
- gzip joystream-node-docker-image.tar
- echo "::set-env name=UPLOAD_NEW_ARTIFACT::true"
- fi
- - name: Build new joystream/node image
- run: |
- if ! [ -f joystream-node-docker-image.tar.gz ]; then
- export JOYSTREAM_NODE_TAG=latest
- docker-compose build
- docker save --output joystream-node-docker-image.tar joystream/node
- gzip joystream-node-docker-image.tar
- echo "::set-env name=UPLOAD_NEW_ARTIFACT::true"
- fi
- - name: Save joystream/node image to Artifacts
- uses: actions/upload-artifact@v2
- with:
- name: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
- path: joystream-node-docker-image.tar.gz
- if: env.UPLOAD_NEW_ARTIFACT
- network_tests_1:
- name: Network Integration Tests (pull request)
- needs: build_images
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - name: Get artifacts
- uses: actions/download-artifact@v2
- with:
- name: ${{ needs.build_images.outputs.use_artifact }}
- - name: Install artifacts
- run: |
- docker load --input joystream-node-docker-image.tar.gz
- docker images
- - name: Install packages and dependencies
- run: yarn install --frozen-lockfile
- - name: Ensure tests are runnable
- run: yarn workspace network-tests build
- - name: Start chain
- run: docker-compose up -d
- - name: Execute network tests
- run: yarn workspace network-tests test
- network_tests_2:
- name: Query Node Tests (Placeholder)
- needs: build_images
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - name: Get artifacts
- uses: actions/download-artifact@v2
- with:
- name: ${{ needs.build_images.outputs.use_artifact }}
- - name: Install artifacts
- run: |
- docker load --input joystream-node-docker-image.tar.gz
- docker images
- - name: Install packages and dependencies
- run: yarn install --frozen-lockfile
- - name: Ensure tests are runnable
- run: yarn workspace network-tests build
- - name: Start chain
- run: docker-compose up -d
- # - name: Execute network tests
- # run: yarn workspace network-tests test
- network_tests_3:
- name: Storage Node Tests
- needs: build_images
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - name: Get artifacts
- uses: actions/download-artifact@v2
- with:
- name: ${{ needs.build_images.outputs.use_artifact }}
- - name: Install artifacts
- run: |
- docker load --input joystream-node-docker-image.tar.gz
- docker images
- - name: Install packages and dependencies
- run: |
- yarn install --frozen-lockfile
- yarn workspace storage-node build
- - name: Build storage node
- run: yarn workspace storage-node build
- - name: Start chain
- run: docker-compose up -d
- - name: Execute tests
- run: DEBUG=* yarn storage-cli dev-init
|