|
| 1 | +name: E2E Tests |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout sources |
| 10 | + uses: actions/checkout@v4 |
| 11 | + |
| 12 | + - name: Build Interlay runtime |
| 13 | + id: srtool_build |
| 14 | + uses: paritytech/srtool-actions@v0.9.3 |
| 15 | + with: |
| 16 | + package: interlay-runtime-parachain |
| 17 | + runtime_dir: parachain/runtime/interlay |
| 18 | + chain: interlay |
| 19 | + |
| 20 | + - name: Save Interlay runtime |
| 21 | + uses: actions/upload-artifact@v4 |
| 22 | + with: |
| 23 | + name: interlay-runtime |
| 24 | + path: | |
| 25 | + ${{ steps.srtool_build.outputs.wasm_compressed }} |
| 26 | +
|
| 27 | + lint: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v3 |
| 31 | + - uses: ./.github/actions/cache-npm |
| 32 | + with: |
| 33 | + cache-key: npm |
| 34 | + |
| 35 | + - name: Use Node.js |
| 36 | + uses: actions/setup-node@v4 |
| 37 | + with: |
| 38 | + node-version: 'lts/*' |
| 39 | + |
| 40 | + - name: Install npm-dependencies |
| 41 | + run: | |
| 42 | + npm install |
| 43 | + working-directory: ./e2e_tests |
| 44 | + |
| 45 | + - name: Run lint |
| 46 | + run: | |
| 47 | + npm run fmt-check |
| 48 | + working-directory: ./e2e_tests |
| 49 | + |
| 50 | + tests: |
| 51 | + needs: [build, lint] |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v3 |
| 55 | + - uses: ./.github/actions/cache-npm |
| 56 | + with: |
| 57 | + cache-key: npm |
| 58 | + |
| 59 | + - name: Download Interlay runtime |
| 60 | + uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + name: interlay-runtime |
| 63 | + path: ./e2e_tests/artifacts |
| 64 | + |
| 65 | + - name: Detect runtime path |
| 66 | + id: runtime |
| 67 | + run: | |
| 68 | + find ./artifacts |
| 69 | + wasm=$(find ./artifacts -type f -name '*.wasm' | head -n1) |
| 70 | + echo "Found runtime wasm: $wasm" |
| 71 | + echo "wasm_path=$wasm" >> $GITHUB_OUTPUT |
| 72 | + working-directory: ./e2e_tests |
| 73 | + |
| 74 | + - name: Use Node.js |
| 75 | + uses: actions/setup-node@v4 |
| 76 | + with: |
| 77 | + node-version: 'lts/*' |
| 78 | + |
| 79 | + - name: Install npm-dependencies |
| 80 | + run: | |
| 81 | + npm install |
| 82 | + working-directory: ./e2e_tests |
| 83 | + |
| 84 | + - name: Run chopsticks |
| 85 | + env: |
| 86 | + WASM_PATH: ${{ steps.runtime.outputs.wasm_path }} |
| 87 | + run: | |
| 88 | + npx @acala-network/chopsticks xcm \ |
| 89 | + -r chopsticks_configs/polkadot.yml \ |
| 90 | + -p chopsticks_configs/interlay.yml \ |
| 91 | + -p chopsticks_configs/polkadot_ah.yml \ |
| 92 | + -p hydradx & |
| 93 | + echo "Chopsticks started" |
| 94 | + working-directory: ./e2e_tests |
| 95 | + |
| 96 | + - name: Wait for chopsticks |
| 97 | + run: | |
| 98 | + for port in 8000 8001 8002 8003; do |
| 99 | + echo "⏳ Waiting for port $port..." |
| 100 | + timeout 60 sh -c "until nc -z localhost $port; do echo -n .; sleep 1; done" |
| 101 | + echo " ✅ Port $port ready" |
| 102 | + done |
| 103 | +
|
| 104 | + - name: Run tests |
| 105 | + run: | |
| 106 | + npm run test |
| 107 | + working-directory: ./e2e_tests |
0 commit comments