Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/cache-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Cache NPM'
description: 'Caching npm dependencies'
inputs:
cache-key:
description: 'Key to use when caching npm dependencies'
required: true
default: 'npm-default'
runs:
using: "composite"
steps:
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-npm-${{ inputs.cache-key }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ inputs.cache-key }}-
${{ runner.os }}-npm-
3 changes: 1 addition & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Publish draft release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+.*"
- "[0-9]+.[0-9]+.[0-9]+.*"
- "*"
workflow_dispatch:

jobs:
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: E2E Tests

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Build Interlay runtime
id: srtool_build
uses: paritytech/[email protected]
with:
package: interlay-runtime-parachain
runtime_dir: parachain/runtime/interlay
chain: interlay

- name: Save Interlay runtime
uses: actions/upload-artifact@v4
with:
name: interlay-runtime
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache-npm
with:
cache-key: npm

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install npm-dependencies
run: |
npm install
working-directory: ./e2e_tests

- name: Run lint
run: |
npm run fmt-check
working-directory: ./e2e_tests

tests:
needs: [build, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache-npm
with:
cache-key: npm

- name: Download Interlay runtime
uses: actions/download-artifact@v4
with:
name: interlay-runtime
path: ./e2e_tests/artifacts

- name: Detect runtime path
id: runtime
run: |
find ./artifacts
wasm=$(find ./artifacts -type f -name '*.wasm' | head -n1)
echo "Found runtime wasm: $wasm"
echo "wasm_path=$wasm" >> $GITHUB_OUTPUT
working-directory: ./e2e_tests

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install npm-dependencies
run: |
npm install
working-directory: ./e2e_tests

- name: Run chopsticks
env:
WASM_PATH: ${{ steps.runtime.outputs.wasm_path }}
run: |
npx @acala-network/chopsticks xcm \
-r chopsticks_configs/polkadot.yml \
-p chopsticks_configs/interlay.yml \
-p chopsticks_configs/polkadot_ah.yml \
-p hydradx &
echo "Chopsticks started"
working-directory: ./e2e_tests

- name: Wait for chopsticks
run: |
for port in 8000 8001 8002 8003; do
echo "⏳ Waiting for port $port..."
timeout 60 sh -c "until nc -z localhost $port; do echo -n .; sleep 1; done"
echo " ✅ Port $port ready"
done

- name: Run tests
run: |
npm run test
working-directory: ./e2e_tests
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ genesis-wasm
rococo-local.json
rococo-local-raw.json

## Node
node_modules

*.log

### Testdata
data/bitcoin-testdata.json
data/bitcoin-testdata.json
Loading