git.delta.rocks / unique-network / refs/commits / 086739e0956b

difftreelog

ci use same lint script as in development

Yaroslav Bolyukin2023-11-14parent: #acb1833.patch.diff
in: master

7 files changed

modified.github/workflows/codestyle.ymldiffbeforeafterboth
before · .github/workflows/codestyle.yml
1# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837012/Code+style+testing2# Nested workflow for checks related to formatting Rust code 34name: codestyle56# Triger: only call from main workflow(re-usable workflows)7on:8  workflow_call:910jobs:11  rustfmt:12    runs-on: [ self-hosted-ci ]13    steps:14      - name: Clean Workspace15        uses: AutoModality/action-clean@v1.1.016      - uses: actions/checkout@v3.1.017        with:18          ref: ${{ github.head_ref }}            19      - name: Read .env file20        uses: xom9ikk/dotenv@v2          21      - name: Install toolchain version from .env22        uses: dtolnay/rust-toolchain@master23        with:24            toolchain: ${{ env.RUST_TOOLCHAIN }}25            targets: wasm32-unknown-unknown26            components: rustfmt, clippy27      - name: Run cargo fmt28        run: cargo fmt -- --check   # In that mode it returns only exit code.29      - name: Cargo fmt state30        if: success()31        run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0."3233  yarn_eslint:34    runs-on: [ self-hosted-ci ]35    steps:36      - name: Clean Workspace37        uses: AutoModality/action-clean@v1.1.038      - uses: actions/checkout@v3.1.039        with:40          ref: ${{ github.head_ref }}            41      - uses: actions/setup-node@v3.5.142        with:43          node-version: 1844      - name: Install modules45        run: cd js-packages && yarn46      - name: Run ESLint47        # run: cd js-packages && yarn eslint --ext .ts,.js --max-warnings=0 src/48        run: cd js-packages && yarn eslint --ext .ts,.js ./*/src4950  clippy:51    runs-on: [ self-hosted-ci ]52    steps:53      - uses: actions/checkout@v3.1.054      - name: Install substrate dependencies55        run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler56      - name: Read .env file57        uses: xom9ikk/dotenv@v258      - name: Install toolchain version from .env59        uses: dtolnay/rust-toolchain@master60        with:61            toolchain: ${{ env.RUST_TOOLCHAIN }}62            targets: wasm32-unknown-unknown63            components: rustfmt, clippy64      - name: Run cargo check65        run: cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests -- -Dwarnings66        env:67          SKIP_WASM_BUILD: '1'
addedjs-packages/.eslintignorediffbeforeafterboth
--- /dev/null
+++ b/js-packages/.eslintignore
@@ -0,0 +1 @@
+*.d.ts
modifiedjs-packages/.eslintrc.jsondiffbeforeafterboth
--- a/js-packages/.eslintrc.json
+++ b/js-packages/.eslintrc.json
@@ -11,7 +11,7 @@
     "parserOptions": {
         "ecmaVersion": 11,
         "sourceType": "module",
-        "project": "**/tsconfig.json"
+        "project": "./tsconfig.json"
     },
     "plugins": [
         "@typescript-eslint",
modifiedjs-packages/package.jsondiffbeforeafterboth
--- a/js-packages/package.json
+++ b/js-packages/package.json
@@ -42,6 +42,7 @@
     ]
   },
   "scripts": {
+    "prepublish": "yarn tsc",
     "lint": "eslint --ext .ts .",
     "fix": "yarn lint --fix",
     "polkadot-types-fetch-metadata": "yarn ts-node --esm scripts/fetchMetadata.ts",
modifiedjs-packages/playgrounds/package.jsondiffbeforeafterboth
--- a/js-packages/playgrounds/package.json
+++ b/js-packages/playgrounds/package.json
@@ -1,7 +1,7 @@
 {
   "author": "",
   "license": "SEE LICENSE IN ../../../LICENSE",
-  "description": "Interfaces for interacting with contracts and contract ABIs",
+  "description": "Playground scripts",
   "engines": {
     "node": ">=16"
   },
modifiedjs-packages/tsconfig.jsondiffbeforeafterboth
--- a/js-packages/tsconfig.json
+++ b/js-packages/tsconfig.json
@@ -12,4 +12,7 @@
 		"strict": true,
 		"resolveJsonModule": true,
 	},
+	"include": [
+		"./**/*.ts"
+	],
 }
deletedscripts/init.shdiffbeforeafterboth
--- a/scripts/init.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-echo "*** Initializing WASM build environment"
-
-if [ -z $CI_PROJECT_NAME ] ; then
-   rustup update nightly
-   rustup update stable
-fi
-
-rustup target add wasm32-unknown-unknown --toolchain nightly