Ver código fonte

workflows: add third set of tests on push

Mokhtar Naamani 4 anos atrás
pai
commit
84c5c3230a

+ 0 - 73
.github/workflows/run-network-tests-privileged.yml

@@ -1,73 +0,0 @@
-name: run-network-tests-privileged
-on:
-  push:
-  workflow_dispatch:
-
-jobs:
-  prepare_docker_images:
-    name: Build new images
-    runs-on: ubuntu-latest
-    outputs:
-      joystream_node_tag: ${{ steps.docker_build.outputs.tag }}
-    steps:
-      - uses: actions/checkout@v1
-      - name: Login to DockerHub
-        uses: docker/login-action@v1
-        with:
-          username: ${{ secrets.DOCKERHUB_USERNAME }}
-          password: ${{ secrets.DOCKERHUB_PASSWORD }}
-      # TODO: Try to not build a new image: compute a hash over rust code and use that as the docker
-      # image tag. (Normally this would be the git repo commit hash but the monorepo contains multiple projects
-      # that is why it is not effective.)
-      - id: docker_build
-        name: Build and publish docker images
-        run: |
-          docker-compose build
-          export JOYSTREAM_NODE_TAG=`docker run joystream/node --version | sed -e 's/^joystream-node //' | tr -d '\n' | tr -d '\r'`
-          docker image tag joystream/node joystream/node:${JOYSTREAM_NODE_TAG}
-          docker push joystream/node:${JOYSTREAM_NODE_TAG}
-          echo "::set-output name=tag::${JOYSTREAM_NODE_TAG}"
-
-  run_network_tests_1:
-    name: Network Integration Runtime Tests
-    needs: prepare_docker_images
-    runs-on: ubuntu-latest
-    env:
-      JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '12.x'
-      - name: Install packages and dependencies
-        run: yarn install --frozen-lockfile
-      - name: Ensure tests are runnable
-        run: yarn workspace network-tests build
-      - name: Pull joystream/node image from Dockerhub
-        run: docker-compose pull
-      - name: Start chain
-        run: docker-compose up -d
-      - name: Execute network tests
-        run: yarn workspace network-tests test
-
-  run_network_tests_2:
-    name: Query Node Tests
-    needs: prepare_docker_images
-    runs-on: ubuntu-latest
-    env:
-      JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '12.x'
-      - name: Install packages and dependencies
-        run: yarn install --frozen-lockfile
-      - name: Ensure tests are runnable
-        run: yarn workspace network-tests build
-      - name: Pull joystream/node image from Dockerhub
-        run: docker-compose pull
-      - name: Start chain
-        run: docker-compose up -d
-      - name: Execute network tests
-        run: yarn workspace network-tests test

+ 82 - 7
.github/workflows/run-network-tests-push.yml

@@ -1,12 +1,39 @@
-name: run-network-tests
-on: 
+name: run-network-tests-branch
+on:
   push:
   workflow_dispatch:
 
 jobs:
-  run_network_tests:
-    name: Network Integration Tests (branch)
+  prepare_docker_images:
+    name: Build new images
     runs-on: ubuntu-latest
+    outputs:
+      joystream_node_tag: ${{ steps.docker_build.outputs.tag }}
+    steps:
+      - uses: actions/checkout@v1
+      - name: Login to DockerHub
+        uses: docker/login-action@v1
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
+      # TODO: Try to not build a new image: compute a hash over rust code and use that as the docker
+      # image tag. (Normally this would be the git repo commit hash but the monorepo contains multiple projects
+      # that is why it is not effective.)
+      - id: docker_build
+        name: Build and publish docker images
+        run: |
+          docker-compose build
+          export JOYSTREAM_NODE_TAG=`docker run joystream/node --version | sed -e 's/^joystream-node //' | tr -d '\n' | tr -d '\r'`
+          docker image tag joystream/node joystream/node:${JOYSTREAM_NODE_TAG}
+          docker push joystream/node:${JOYSTREAM_NODE_TAG}
+          echo "::set-output name=tag::${JOYSTREAM_NODE_TAG}"
+
+  run_network_tests_1:
+    name: Network Integration Runtime Tests
+    needs: prepare_docker_images
+    runs-on: ubuntu-latest
+    env:
+      JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
     steps:
       - uses: actions/checkout@v1
       - uses: actions/setup-node@v1
@@ -16,9 +43,57 @@ jobs:
         run: yarn install --frozen-lockfile
       - name: Ensure tests are runnable
         run: yarn workspace network-tests build
+      - name: Pull joystream/node image from Dockerhub
+        run: docker-compose pull
       - name: Start chain
-        run: |
-          JOYSTREAM_NODE_TAG=latest docker-compose build
-          JOYSTREAM_NODE_TAG=latest docker-compose up -d
+        run: docker-compose up -d
       - name: Execute network tests
         run: yarn workspace network-tests test
+
+  run_network_tests_2:
+    name: Query Node Tests (Placeholder)
+    needs: prepare_docker_images
+    runs-on: ubuntu-latest
+    env:
+      JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
+    steps:
+      - uses: actions/checkout@v1
+      - uses: actions/setup-node@v1
+        with:
+          node-version: '12.x'
+      - name: Install packages and dependencies
+        run: yarn install --frozen-lockfile
+      - name: Ensure tests are runnable
+        run: yarn workspace network-tests build
+      - name: Pull joystream/node image from Dockerhub
+        run: docker-compose pull
+      - name: Start chain
+        run: docker-compose up -d
+      - name: Execute network tests
+        run: yarn workspace network-tests test
+
+  # These tests will fail because storage-node has not been updated for latest rutnime types
+  # for babylon
+  run_network_tests_3:
+    name: Storage Node Tests
+    needs: prepare_docker_images
+    runs-on: ubuntu-latest
+    env:
+      JOYSTREAM_NODE_TAG: ${{ needs.prepare_docker_images.outputs.joystream_node_tag }}
+    steps:
+      - uses: actions/checkout@v1
+      - uses: actions/setup-node@v1
+        with:
+          node-version: '12.x'
+      - 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: Pull joystream/node image from Dockerhub
+        run: docker-compose pull
+      - name: Start chain
+        run: docker-compose up -d
+      - name: Execute tests
+        run: DEBUG=* yarn storage-cli dev-init

+ 32 - 0
docker-compose-with-storage.yaml

@@ -0,0 +1,32 @@
+version: '3'
+services:
+  ipfs:
+    image: ipfs/go-ipfs:latest
+    ports:
+      - '127.0.0.1:5001:5001'
+      - '127.0.0.1:8080:8080'
+    volumes:
+      - ipfs-data:/data/ipfs
+    entrypoint: ''
+    command: |
+      /bin/sh -c "
+        set -e
+        /usr/local/bin/start_ipfs config profile apply lowpower
+        /usr/local/bin/start_ipfs config --json Gateway.PublicGateways '{\"localhost\": null }'
+        /sbin/tini -- /usr/local/bin/start_ipfs daemon --migrate=true
+      "
+  chain:
+    image: "joystream/node:${JOYSTREAM_NODE_TAG}"
+    build:
+      context: .
+      dockerfile: joystream-node.Dockerfile
+    ports:
+      - '127.0.0.1:9944:9944'
+    volumes:
+      - chain-data:/data
+    command: --dev --ws-external --base-path /data
+volumes:
+  ipfs-data:
+    driver: local
+  chain-data:
+    driver: local