Skip to content

Commit c4815e1

Browse files
author
Adithya Krishna
authored
fix: CI workflows bug and linting (#109)
* fix: ci workflows bug and linting Signed-off-by: Adithya Krishna <[email protected]> * Updated node version Signed-off-by: Adithya Krishna <[email protected]> * Fixed Linting Issues Signed-off-by: Adithya Krishna <[email protected]> * Fixed Linting Issues Signed-off-by: Adithya Krishna <[email protected]> * Added EOL Signed-off-by: Adithya Krishna <[email protected]> * Fixed CodeQL Bug Signed-off-by: Adithya Krishna <[email protected]> --------- Signed-off-by: Adithya Krishna <[email protected]>
1 parent 30282fd commit c4815e1

File tree

190 files changed

+61999
-61996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+61999
-61996
lines changed

.eslintrc.js

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
module.exports = {
2-
parser: '@typescript-eslint/parser',
3-
env: {
4-
browser: true,
5-
es6: true,
2+
parser: '@typescript-eslint/parser',
3+
env: {
4+
browser: true,
5+
es6: true,
6+
},
7+
plugins: [
8+
'react',
9+
'jsx-a11y',
10+
'import',
11+
'prettier',
12+
'react-hooks',
13+
'regexp',
14+
'@typescript-eslint',
15+
],
16+
extends: [
17+
'airbnb',
18+
'plugin:prettier/recommended',
19+
'plugin:jsx-a11y/recommended',
20+
'plugin:import/errors',
21+
'plugin:import/warnings',
22+
'plugin:@typescript-eslint/eslint-recommended',
23+
'plugin:@typescript-eslint/recommended',
24+
],
25+
parserOptions: {
26+
ecmaFeatures: {
27+
jsx: true,
628
},
7-
plugins: [
8-
'react',
9-
'jsx-a11y',
10-
'import',
11-
'prettier',
12-
'react-hooks',
13-
'regexp',
14-
'@typescript-eslint',
29+
ecmaVersion: 2021,
30+
sourceType: 'module',
31+
},
32+
rules: {
33+
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
34+
'react/prop-types': 'off',
35+
'react/jsx-filename-extension': [
36+
1,
37+
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
1538
],
16-
extends: [
17-
'airbnb',
18-
'plugin:prettier/recommended',
19-
'plugin:jsx-a11y/recommended',
20-
'plugin:import/errors',
21-
'plugin:import/warnings',
22-
'plugin:@typescript-eslint/eslint-recommended',
23-
'plugin:@typescript-eslint/recommended',
24-
],
25-
parserOptions: {
26-
ecmaFeatures: {
27-
jsx: true,
28-
},
29-
ecmaVersion: 2021,
30-
sourceType: 'module',
31-
},
32-
rules: {
33-
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
34-
'react/prop-types': 'off',
35-
'react/jsx-filename-extension': [
36-
1,
37-
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
38-
],
39-
'react/jsx-props-no-spreading': 'off',
40-
'react/destructuring-assignment': ['warn'],
41-
'import/no-unresolved': 'off',
42-
'import/extensions': 'off',
43-
'react-hooks/rules-of-hooks': 'warn',
44-
'react-hooks/exhaustive-deps': 'warn',
45-
'regexp/no-unused-capturing-group': 'error',
46-
'regexp/no-useless-backreference': 'error',
47-
},
48-
settings: {
49-
'import/resolver': {
50-
node: {
51-
extensions: ['.js', '.jsx', '.json'],
52-
},
53-
},
39+
'react/jsx-props-no-spreading': 'off',
40+
'react/destructuring-assignment': ['warn'],
41+
'import/no-unresolved': 'off',
42+
'import/extensions': 'off',
43+
'react-hooks/rules-of-hooks': 'warn',
44+
'react-hooks/exhaustive-deps': 'warn',
45+
'regexp/no-unused-capturing-group': 'error',
46+
'regexp/no-useless-backreference': 'error',
47+
},
48+
settings: {
49+
'import/resolver': {
50+
node: {
51+
extensions: ['.js', '.jsx', '.json'],
52+
},
5453
},
54+
},
5555
};

.github/workflows/codeql-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ jobs:
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v3
31+
3132
- name: Initialize CodeQL
3233
uses: github/codeql-action/[email protected]
3334
with:
3435
languages: ${{ matrix.language }}
36+
3537
- name: Perform CodeQL Analysis
3638
uses: github/codeql-action/[email protected]

.github/workflows/dependency-review.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v3
17+
1718
- name: Dependency Review
1819
uses: actions/dependency-review-action@v2

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Node.js
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: 16
25+
node-version: 16.14.0
2626
cache: 'npm'
2727

2828
- name: Cache NPM Dependencies

.github/workflows/lint.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Lint Check
1+
name: Lint
22

33
on:
4+
workflow_dispatch:
5+
push:
46
pull_request:
57
branches:
68
- main
7-
- docusaurus-v**
89

910
concurrency:
1011
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -14,18 +15,25 @@ permissions:
1415
contents: read
1516

1617
jobs:
17-
lint-markdown:
18-
name: Lint markdown
18+
lint:
19+
name: Lint
20+
timeout-minutes: 30
1921
runs-on: ubuntu-latest
2022
steps:
21-
- name: Checkout code
23+
- name: Checkout
2224
uses: actions/checkout@v3
2325

24-
- name: Lint markdown format
25-
uses: github/super-linter/slim@v5
26-
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
DEFAULT_BRANCH: main
29-
FILTER_REGEX_INCLUDE: .*docs/.*md$
30-
VALIDATE_ALL_CODEBASE: false
31-
VALIDATE_MARKDOWN: true
26+
- name: Set up Node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 16.14.0
30+
cache: npm
31+
32+
- name: Installation
33+
run: npm install
34+
35+
- name: Lint
36+
run: npm run lint:ci
37+
38+
- name: Prettier Code
39+
run: npm run format:diff

.lintstagedrc.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"*.{js,jsx,mjs}": ["eslint --fix"],
3-
"*.css": ["stylelint --allow-empty-input --fix"],
4-
"*": [
5-
"prettier --ignore-unknown --write",
6-
"cspell --no-must-find-files --no-progress"
7-
]
2+
"*.{js,jsx,mjs}": ["eslint --fix"],
3+
"*.css": ["stylelint --allow-empty-input --fix"],
4+
"*": [
5+
"prettier --ignore-unknown --write",
6+
"cspell --no-must-find-files --no-progress"
7+
]
88
}

.prettierrc

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"arrowParens": "always",
3-
"bracketSpacing": true,
4-
"bracketSameLine": true,
5-
"printWidth": 80,
6-
"proseWrap": "never",
7-
"singleQuote": true,
8-
"trailingComma": "all",
9-
"tabWidth": 4
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"bracketSameLine": true,
5+
"printWidth": 80,
6+
"proseWrap": "never",
7+
"singleQuote": true,
8+
"trailingComma": "all",
9+
"tabWidth": 2
1010
}

.stylelintrc.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = {
2-
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
3-
rules: {
4-
'selector-pseudo-class-no-unknown': [
5-
true,
6-
{
7-
ignorePseudoClasses: ['global'],
8-
},
9-
],
10-
'selector-class-pattern': null,
11-
'custom-property-empty-line-before': null,
12-
'selector-id-pattern': null,
13-
'declaration-empty-line-before': null,
14-
'comment-empty-line-before': null,
15-
'value-keyword-case': ['lower', { camelCaseSvgKeywords: true }],
16-
},
2+
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
3+
rules: {
4+
'selector-pseudo-class-no-unknown': [
5+
true,
6+
{
7+
ignorePseudoClasses: ['global'],
8+
},
9+
],
10+
'selector-class-pattern': null,
11+
'custom-property-empty-line-before': null,
12+
'selector-id-pattern': null,
13+
'declaration-empty-line-before': null,
14+
'comment-empty-line-before': null,
15+
'value-keyword-case': ['lower', { camelCaseSvgKeywords: true }],
16+
},
1717
};

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"cSpell.words": ["bytecode", "CNCF", "Emscripten", "wasmedge"]
2+
"cSpell.words": ["bytecode", "CNCF", "Emscripten", "wasmedge"]
33
}

CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ If you are ready to contribute, please search for open issues labeled "help-want
88

99
**Contents**
1010

11-
- <a name="contributing-flow">Contribution Flow</a>
12-
- <a href="#commit-signoff">Developer Certificate of Origin</a>
13-
- WasmEdge Contribution Flow
14-
- <a href="#contributing-docs">WasmEdge Docs</a>
15-
- <a href="https://wasmedge.org/docs/contribute/" target="_blank">WasmEdge Runtime</a>
16-
- <a href="https://github.com/WasmEdge/WasmEdge/blob/master/SECURITY.md" target="_blank">Reporting a vulnerability</a>
11+
- <a name="contributing-flow">Contribution Flow</a>
12+
- <a href="#commit-signoff">Developer Certificate of Origin</a>
13+
- WasmEdge Contribution Flow
14+
- <a href="#contributing-docs">WasmEdge Docs</a>
15+
- <a href="https://wasmedge.org/docs/contribute/" target="_blank">WasmEdge Runtime</a>
16+
- <a href="https://github.com/WasmEdge/WasmEdge/blob/master/SECURITY.md" target="_blank">Reporting a vulnerability</a>
1717

1818
# <a name="contributing-flow">Contribution Flow</a>
1919

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
33
};
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "WasmEdge Plugin System",
3-
"position": 3,
4-
"link": {
5-
"type": "generated-index",
6-
"description": "we will learn how to the WasmEdge Plugin System."
7-
}
2+
"label": "WasmEdge Plugin System",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "we will learn how to the WasmEdge Plugin System."
7+
}
88
}
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Build WasmEdge from source",
3-
"position": 2,
4-
"link": {
5-
"type": "generated-index",
6-
"description": "we will learn how to the WasmEdge Plugin System."
7-
}
2+
"label": "Build WasmEdge from source",
3+
"position": 2,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "we will learn how to the WasmEdge Plugin System."
7+
}
88
}

docs/contribute/source/build_from_src.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ Please follow this guide to build and test WasmEdge from the source code.
2323
WasmEdge provides various tools for enabling different runtime environments for optimal performance. You can find that there are several wasmedge related tools:
2424

2525
1. `wasmedge` is the general wasm runtime.
26-
- `wasmedge` executes a `WASM` file in the interpreter mode or a compiled `WASM` file in the ahead-of-time compilation mode.
27-
- To disable building all tools, you can set the CMake option `WASMEDGE_BUILD_TOOLS` to `OFF`.
26+
- `wasmedge` executes a `WASM` file in the interpreter mode or a compiled `WASM` file in the ahead-of-time compilation mode.
27+
- To disable building all tools, you can set the CMake option `WASMEDGE_BUILD_TOOLS` to `OFF`.
2828
2. `wasmedgec` is the ahead-of-time `WASM` compiler.
29-
- `wasmedgec` compiles a general `WASM` file into a compiled `WASM` file.
30-
- To disable building the ahead-of-time compiler only, you can set the CMake option `WASMEDGE_BUILD_AOT_RUNTIME` to `OFF`.
29+
- `wasmedgec` compiles a general `WASM` file into a compiled `WASM` file.
30+
- To disable building the ahead-of-time compiler only, you can set the CMake option `WASMEDGE_BUILD_AOT_RUNTIME` to `OFF`.
3131
3. `libwasmedge.so` is the WasmEdge C API shared library. (`libwasmedge.dylib` on MacOS and `wasmedge.dll` on Windows)
32-
- `libwasmedge.so`, `libwasmedge.dylib`, or `wasmedge.dll` provides the C API for the ahead-of-time compiler and the WASM runtime.
33-
- The APIs related to the ahead-of-time compiler will always fail if the CMake option `WASMEDGE_BUILD_AOT_RUNTIME` is set as `OFF`.
34-
- To disable building just the shared library, you can set the CMake option `WASMEDGE_BUILD_SHARED_LIB` to `OFF`.
32+
- `libwasmedge.so`, `libwasmedge.dylib`, or `wasmedge.dll` provides the C API for the ahead-of-time compiler and the WASM runtime.
33+
- The APIs related to the ahead-of-time compiler will always fail if the CMake option `WASMEDGE_BUILD_AOT_RUNTIME` is set as `OFF`.
34+
- To disable building just the shared library, you can set the CMake option `WASMEDGE_BUILD_SHARED_LIB` to `OFF`.
3535
4. `ssvm-qitc` is for AI applications and supports the ONNC runtime for AI models in the ONNX format.
36-
- If you want to try `ssvm-qitc`, please refer to [ONNC-Wasm](https://github.com/ONNC/onnc-wasm) project to set up the working environment and tryout several examples.
37-
- And here is our [tutorial for ONNC-Wasm project(YouTube Video)](https://www.youtube.com/watch?v=cbiPuHMS-iQ).
36+
- If you want to try `ssvm-qitc`, please refer to [ONNC-Wasm](https://github.com/ONNC/onnc-wasm) project to set up the working environment and tryout several examples.
37+
- And here is our [tutorial for ONNC-Wasm project(YouTube Video)](https://www.youtube.com/watch?v=cbiPuHMS-iQ).
3838

3939
## CMake Building Options
4040

@@ -43,24 +43,24 @@ Developers can set the CMake options to customize the WasmEdge building.
4343
1. `WASMEDGE_BUILD_TESTS`: build the WasmEdge tests. Default is `OFF`.
4444
2. `WASMEDGE_BUILD_AOT_RUNTIME`: build with the Ahead-of-Time compiler supporting. Default is `ON`.
4545
3. `WASMEDGE_BUILD_SHARED_LIB`: build the WasmEdge shared library (`libwasmedge.so`, `libwasmedge.dylib`, or `wasmedge.dll`). Default is `ON`.
46-
- By default, the WasmEdge shared library will link to the LLVM shared library.
46+
- By default, the WasmEdge shared library will link to the LLVM shared library.
4747
4. `WASMEDGE_BUILD_STATIC_LIB`: build the WasmEdge static library (`libwasmedge.a`, Linux and MacOS platforms, experimental). Default is `OFF`.
48-
- If this option is set as `ON`, the option `WASMEDGE_FORCE_DISABLE_LTO` will forcefully be set as `ON`.
49-
- If this option is set as `ON`, the `libz` and `libtinfo` on Linux platforms will be statically linked.
50-
- For linking with `libwasmedge.a`, developers should also add the `-ldl`, `-pthread`, `-lm`, and `-lstdc++` linker options on both Linux and MacOS platforms, and `-lrt` on Linux platforms.
48+
- If this option is set as `ON`, the option `WASMEDGE_FORCE_DISABLE_LTO` will forcefully be set as `ON`.
49+
- If this option is set as `ON`, the `libz` and `libtinfo` on Linux platforms will be statically linked.
50+
- For linking with `libwasmedge.a`, developers should also add the `-ldl`, `-pthread`, `-lm`, and `-lstdc++` linker options on both Linux and MacOS platforms, and `-lrt` on Linux platforms.
5151
5. `WASMEDGE_BUILD_TOOLS`: build the `wasmedge` and `wasmedgec` tools. Default is `ON`.
52-
- The `wasmedge` and `wasmedgec` tools will link to the WasmEdge shared library by default.
53-
- If this option is set as `ON` and `WASMEDGE_BUILD_AOT_RUNTIME` is set as `OFF`, the `wasmedgec` tool for the AOT compiler will not be built.
54-
- If this option is set as `ON` but the option `WASMEDGE_LINK_TOOLS_STATIC` is set as `OFF`, the option `WASMEDGE_BUILD_SHARED_LIB` will forcefully be set as `ON`.
55-
- If this option and the option `WASMEDGE_LINK_TOOLS_STATIC` are both set as `ON`, the `WASMEDGE_LINK_LLVM_STATIC` and `WASMEDGE_BUILD_STATIC_LIB` will both be set as `ON`, and the `wasmedge` and `wasmedgec` tools will link to the WasmEdge static library instead. In this case, the plugins will not work in tools.
52+
- The `wasmedge` and `wasmedgec` tools will link to the WasmEdge shared library by default.
53+
- If this option is set as `ON` and `WASMEDGE_BUILD_AOT_RUNTIME` is set as `OFF`, the `wasmedgec` tool for the AOT compiler will not be built.
54+
- If this option is set as `ON` but the option `WASMEDGE_LINK_TOOLS_STATIC` is set as `OFF`, the option `WASMEDGE_BUILD_SHARED_LIB` will forcefully be set as `ON`.
55+
- If this option and the option `WASMEDGE_LINK_TOOLS_STATIC` are both set as `ON`, the `WASMEDGE_LINK_LLVM_STATIC` and `WASMEDGE_BUILD_STATIC_LIB` will both be set as `ON`, and the `wasmedge` and `wasmedgec` tools will link to the WasmEdge static library instead. In this case, the plugins will not work in tools.
5656
6. `WASMEDGE_BUILD_PLUGINS`: build the WasmEdge plugins. Default is `ON`.
5757
7. `WASMEDGE_BUILD_EXAMPLE`: build the WasmEdge examples. Default is `OFF`.
5858
8. `WASMEDGE_PLUGIN_WASI_NN_BACKEND`: build the WasmEdge WASI-NN plugin (Linux platforms only). Default is empty.
59-
- This option is useless if the option `WASMEDGE_BUILD_PLUGINS` is set as `OFF`.
60-
- To build the WASI-NN plugin with backend, please use `-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=<backend_name>`.
61-
- To build the WASI-NN plugin with multiple backends, please use `-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=<backend_name1>,<backend_name2>`.
59+
- This option is useless if the option `WASMEDGE_BUILD_PLUGINS` is set as `OFF`.
60+
- To build the WASI-NN plugin with backend, please use `-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=<backend_name>`.
61+
- To build the WASI-NN plugin with multiple backends, please use `-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=<backend_name1>,<backend_name2>`.
6262
9. `WASMEDGE_PLUGIN_WASI_CRYPTO`: build the WasmEdge WASI-Crypto plugin (Linux platforms only). Default is `OFF`.
63-
- This option is useless if the option `WASMEDGE_BUILD_PLUGINS` is set as `OFF`.
63+
- This option is useless if the option `WASMEDGE_BUILD_PLUGINS` is set as `OFF`.
6464
10. `WASMEDGE_FORCE_DISABLE_LTO`: forcefully turn off the link time optimization. Default is `OFF`.
6565
11. `WASMEDGE_LINK_LLVM_STATIC`: link the LLVM and lld libraries statically (Linux and MacOS platforms only, experimental). Default is `OFF`.
6666
12. `WASMEDGE_LINK_TOOLS_STATIC`: make the `wasmedge` and `wasmedgec` tools to link the WasmEdge library and LLVM libraries statically (Linux and MacOS platforms only, experimental). Default is `OFF`.
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Build WasmEdge",
3-
"position": 3,
4-
"link": {
5-
"type": "generated-index",
6-
"description": "we will learn how to build WasmEdge from source on different OSes."
7-
}
2+
"label": "Build WasmEdge",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "we will learn how to build WasmEdge from source on different OSes."
7+
}
88
}

0 commit comments

Comments
 (0)