Skip to content

Commit

Permalink
CI: add job test-last-tracing-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Apr 7, 2022
1 parent 5b2bdd1 commit a0b57d2
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
types: [opened, edited, synchronize]

env:
MOONBEAM_GIT_REF: "master"
MOONBEAM_LAST_CLIENT_TAG: "v0.22.0"

jobs:

list-spec-versions:
Expand Down Expand Up @@ -101,3 +105,35 @@ jobs:
if: steps.filter.outputs.edited == 'true' || steps.filter.outputs.shared == 'true'
run: |
./scripts/check-tracing-runtime.sh ${{ matrix.spec_version }}
test-last-tracing-runtime:
name: "Test last tracing runtime"
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: ["check-tracing-runtime"]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get moonbeam binary
run: |
./scripts/get-moonbeam-binary.sh $MOONBEAM_LAST_CLIENT_TAG
- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Copy tests folder
run: |
rm -rf tests tmp
mkdir tests tmp
git clone https://github.com/PureStake/moonbeam --depth 1 -b $MOONBEAM_GIT_REF tmp/moonbeam
cp -r tmp/moonbeam/moonbeam-types-bundle .
cp -r tmp/moonbeam/tests .
- name: Typescript tracing tests (against dev service)
continue-on-error: true
env:
ETHAPI_CMD: --ethapi=txpool,debug,trace
FORCE_WASM_EXECUTION: true
WASM_RUNTIME_OVERRIDES: moonbase-overrides
run: ./scripts/test-last-tracing-runtime.sh
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
# Ignore build directory populated by CI
build

# Ignore temporary files
# Ignore moonbeam test files
moonbeam-types-bundle
tests
tmp
9 changes: 9 additions & 0 deletions scripts/get-moonbeam-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

CLIENT_TAG=$1
CLIENT_IMAGE="purestake/moonbeam:$CLIENT_TAG"

mkdir -p target/release
docker create -ti --name dummy $CLIENT_IMAGE bash
docker cp dummy:/moonbeam/moonbeam target/release/moonbeam
docker rm -f dummy
13 changes: 13 additions & 0 deletions scripts/test-last-tracing-runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

WASM_RUNTIME_OVERRIDES="moonbase-overrides"

chmod uog+x target/release/moonbeam
mkdir -p tests/$WASM_RUNTIME_OVERRIDES
cp wasm/moonbase-* tests/$WASM_RUNTIME_OVERRIDES
cd moonbeam-types-bundle
npm install
npm run build
cd ../tests
npm install
node_modules/.bin/mocha --parallel -j 1 -r ts-node/register 'tracing-tests/**/test-*.ts'

0 comments on commit a0b57d2

Please sign in to comment.