Browse Source

network tests: two separate workflows for push and pull request

Mokhtar Naamani 4 years ago
parent
commit
2ded2b9f9d

+ 5 - 9
.github/workflows/run-network-tests.yml → .github/workflows/run-network-tests-pull-request.yml

@@ -1,13 +1,12 @@
-name: run-network-tests
+name: run-network-tests-pull-request
 on:
   pull_request:
     types: [labeled, synchronize]
-  workflow_dispatch:
 
 jobs:
   run_network_tests:
-    name: Network Integration Tests
-    if: contains(github.event.pull_request.labels.*.name, 'run-network-tests') || github.event.action == null
+    name: Network Integration Tests (pull request)
+    if: contains(github.event.pull_request.labels.*.name, 'run-network-tests')
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
@@ -29,11 +28,8 @@ jobs:
         run: yarn install --frozen-lockfile
       - name: Ensure tests are runnable
         run: yarn workspace network-tests build
-      - name: Maybe build joystream/node Docker image from source
-        run: |
-          echo "joystream-node source modified. Will build from source."  
-          export JOYSTREAM_NODE_TAG=${{ github.event.pull_request.base.ref }}
-          docker-compose build
+      - name: Build joystream/node Docker image from source
+        run: JOYSTREAM_NODE_TAG=${{ github.event.pull_request.base.ref }} docker-compose build
         if: env.GIT_DIFF
       - name: Start chain
         run: JOYSTREAM_NODE_TAG=${{ github.event.pull_request.base.ref }} docker-compose up -d

+ 22 - 0
.github/workflows/run-network-tests-push.yml

@@ -0,0 +1,22 @@
+name: run-network-tests
+on: 
+  push:
+  workflow_dispatch:
+
+jobs:
+  run_network_tests:
+    name: Network Integration Tests (branch)
+    runs-on: ubuntu-latest
+    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: Start chain
+        run: docker-compose up -d
+      - name: Execute network tests
+        run: yarn workspace network-tests test