Additional CI actions (#5036)

This commit is contained in:
Jaco
2022-07-06 00:22:36 +03:00
committed by GitHub
parent ed1e3987dc
commit 617a03ec05
7 changed files with 78 additions and 7 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ const base = require('@polkadot/dev/config/eslint.cjs');
module.exports = {
...base,
ignorePatterns: [
...base.ignorePatterns
...base.ignorePatterns,
'**/deno/*.ts'
],
parserOptions: {
...base.parserOptions,
+5 -1
View File
@@ -5,14 +5,18 @@ jobs:
pr:
strategy:
matrix:
step: ['lint', 'test', 'build']
step: ['lint', 'test', 'build', 'deno']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: ${{ matrix.step }}
if: always()
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2019-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// auto-generated via deno/setup.ts, do not edit
export * as api from 'https://deno.land/x/polkadot/api/mod.ts';
export * as apiAugment from 'https://deno.land/x/polkadot/api-augment/mod.ts';
export * as apiBase from 'https://deno.land/x/polkadot/api-base/mod.ts';
export * as apiContract from 'https://deno.land/x/polkadot/api-contract/mod.ts';
export * as apiDerive from 'https://deno.land/x/polkadot/api-derive/mod.ts';
export * as rpcAugment from 'https://deno.land/x/polkadot/rpc-augment/mod.ts';
export * as rpcCore from 'https://deno.land/x/polkadot/rpc-core/mod.ts';
export * as rpcProvider from 'https://deno.land/x/polkadot/rpc-provider/mod.ts';
export * as types from 'https://deno.land/x/polkadot/types/mod.ts';
export * as typesAugment from 'https://deno.land/x/polkadot/types-augment/mod.ts';
export * as typesCodec from 'https://deno.land/x/polkadot/types-codec/mod.ts';
export * as typesCreate from 'https://deno.land/x/polkadot/types-create/mod.ts';
export * as typesKnown from 'https://deno.land/x/polkadot/types-known/mod.ts';
+17
View File
@@ -0,0 +1,17 @@
{
"imports": {
"https://deno.land/x/polkadot/rpc-core/": "../packages/rpc-core/build-deno/",
"https://deno.land/x/polkadot/types-augment/": "../packages/types-augment/build-deno/",
"https://deno.land/x/polkadot/types-create/": "../packages/types-create/build-deno/",
"https://deno.land/x/polkadot/types/": "../packages/types/build-deno/",
"https://deno.land/x/polkadot/api-base/": "../packages/api-base/build-deno/",
"https://deno.land/x/polkadot/types-known/": "../packages/types-known/build-deno/",
"https://deno.land/x/polkadot/rpc-provider/": "../packages/rpc-provider/build-deno/",
"https://deno.land/x/polkadot/api-augment/": "../packages/api-augment/build-deno/",
"https://deno.land/x/polkadot/api/": "../packages/api/build-deno/",
"https://deno.land/x/polkadot/rpc-augment/": "../packages/rpc-augment/build-deno/",
"https://deno.land/x/polkadot/types-codec/": "../packages/types-codec/build-deno/",
"https://deno.land/x/polkadot/api-contract/": "../packages/api-contract/build-deno/",
"https://deno.land/x/polkadot/api-derive/": "../packages/api-derive/build-deno/"
}
}
+27
View File
@@ -0,0 +1,27 @@
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
import { stringCamelCase } from 'https://deno.land/x/polkadot/util/mod.ts';
const exports: string[] = [];
const imports: Record<string, string> = {};
for await (const entry of Deno.readDir('packages')) {
if (entry.isDirectory) {
try {
await Deno.readTextFile(`packages/${entry.name}/src/mod.ts`);
exports.push(`export * as ${stringCamelCase(entry.name)} from 'https://deno.land/x/polkadot/${entry.name}/mod.ts';`);
imports[`https://deno.land/x/polkadot/${entry.name}/`] = `../packages/${entry.name}/build-deno/`;
} catch {
// ignore
}
}
}
await Deno.writeTextFile('deno/check.ts', `// Copyright 2017-${new Date().getFullYear()} @polkadot/api authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n// auto-generated via deno/setup.ts, do not edit\n\n${exports.sort().join('\n')}\n`);
await Deno.writeTextFile('deno/import_map.json', `${JSON.stringify({ imports }, null, 2)}\n`);
+3 -1
View File
@@ -23,7 +23,9 @@
"build:rollup": "polkadot-exec-rollup --config",
"chain:info": "polkadot-types-chain-info",
"clean": "polkadot-dev-clean-build",
"docs:metadata": "polkadot-types-internal-metadata",
"deno": "yarn build && yarn deno:setup && yarn deno:check",
"deno:check": "deno check --import-map=deno/import_map.json deno/check.ts",
"deno:setup": "deno run --import-map=deno/import_map.json --allow-read --allow-write deno/setup.ts",
"lint": "polkadot-dev-run-lint",
"postinstall": "polkadot-dev-yarn-only",
"test": "polkadot-dev-run-test --coverage --forceExit --runInBand --testPathIgnorePatterns e2e",
+6 -4
View File
@@ -214,10 +214,12 @@ export class WsProvider implements ProviderInterface {
maxReceivedMessageSize: 24 * MEGABYTE
});
this.#websocket.onclose = this.#onSocketClose;
this.#websocket.onerror = this.#onSocketError;
this.#websocket.onmessage = this.#onSocketMessage;
this.#websocket.onopen = this.#onSocketOpen;
if (this.#websocket) {
this.#websocket.onclose = this.#onSocketClose;
this.#websocket.onerror = this.#onSocketError;
this.#websocket.onmessage = this.#onSocketMessage;
this.#websocket.onopen = this.#onSocketOpen;
}
// timeout any handlers that have not had a response
this.#timeoutId = setInterval(() => this.#timeoutHandlers(), TIMEOUT_INTERVAL);