Skip to content

Commit

Permalink
github action (#4)
Browse files Browse the repository at this point in the history
* github action

* executor

* update toolchain version

* ci avoid use cargo

* increase timeout
  • Loading branch information
xlc authored Oct 25, 2022
1 parent 0175add commit 5aade18
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-10-16
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: yarn --immutable
- run: yarn lint
- run: yarn build
- run: yarn test

4 changes: 3 additions & 1 deletion e2e/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { handler } from '../src/rpc'

const setupAll = async () => {
const endpoint = 'wss://mandala-rpc.aca-staging.network/ws'
const executorCmd = 'cargo run --manifest-path executor/Cargo.toml --'
const executorCmd = process.env.CI
? './executor/target/debug/executor'
: 'cargo run --manifest-path executor/Cargo.toml --'
const blockHash = '0x68cff8682eda3e5e63b375253bdb3a01f0dce1879fe7ade97c9697406c56b55a'

const wsProvider = new WsProvider(endpoint)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"fix": "eslint . --ext .js,.ts --fix && prettier -w .",
"prepare": "husky install",
"start": "ts-node src/index.ts",
"build": "cd executor && cargo build --locked",
"test": "vitest",
"dev": "LOG_LEVEL=trace node-dev --notify=false src/index.ts -- dev --endpoint=wss://karura-rococo-rpc.aca-staging.network/ws --executor-cmd='cargo run --manifest-path executor/Cargo.toml --' | pino-pretty"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules"]
"exclude": ["node_modules", "vendor"]
}
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
testTimeout: 10000,
testTimeout: 30000,
},
})

0 comments on commit 5aade18

Please sign in to comment.