Skip to content

Commit

Permalink
Merge pull request #693 from massalabs/the_merge
Browse files Browse the repository at this point in the history
Merge next version
  • Loading branch information
peterjah authored Oct 29, 2024
2 parents 4b83b1a + ee340ef commit afa381f
Show file tree
Hide file tree
Showing 294 changed files with 28,674 additions and 29,237 deletions.
20 changes: 13 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
build
node_modules
.github
bundle.*
docs
dist
scripts
*.config.js
*.config.ts
package*.json
.eslintrc.cjs
bundle*.js

**/open_rpc/**
**/generated/**
**/dist/**
**/docs/**
typedoc.json
tsconfig.json
test
103 changes: 93 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,94 @@
/* eslint-env node */
module.exports = {
extends: ["@massalabs","prettier"],
rules: {
"tsdoc/syntax": "warn",
"max-len": ["error", 200],
camelcase: "off",
"@typescript-eslint/no-unused-vars": "error",
'no-console': 'warn',
"comma-dangle": "off"
},
};
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/stylistic',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
rules: {
'no-else-return': ['error', { allowElseIf: false }],
'func-style': ['error', 'declaration', { 'allowArrowFunctions': false }],
'no-magic-numbers': 'off',
'@typescript-eslint/no-magic-numbers': [
'error',
{
ignoreArrayIndexes: true,
enforceConst: true,
detectObjects: true,
ignoreEnums: true,
ignore: [0,1,-1,'0n','1n'],
},
],
'@typescript-eslint/ban-tslint-comment': 'off',
'@typescript-eslint/consistent-type-definitions': [
'error',
'type'
],
'max-params': ['error', 4],
'class-methods-use-this': ['error', { exceptMethods: [] }],
'@typescript-eslint/explicit-function-return-type': ['warn'],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'variable',
format: ['camelCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'variable',
modifiers: ['const'],
format: ['camelCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'variable',
modifiers: ['const', 'global'],
format: ['UPPER_CASE'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'parameter',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'forbid',
},
{
selector: 'typeLike',
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'enumMember',
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
],
// Not working for now. To investigate at some point.
//'@typescript-eslint/prefer-nullish-coalescing': [
// 'error',
// { ignoreConditionalTests: true, ignoreMixedLogicalExpressions: true },
//],
},
};
21 changes: 21 additions & 0 deletions .github/workflows/coverage-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: coverage repport
on:
push:

jobs:
test:
uses: ./.github/workflows/unit-tests.yml
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: jwalton/gh-find-current-pr@v1
id: findPr

- uses: ArtiomTr/jest-coverage-report-action@v2
with:
custom-title: Coverage report for experimental massa-web3
prnumber: ${{ steps.findPr.outputs.number }}
working-directory: ./
test-script: npm test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: (workspace) Deploy documentation
name: Deploy documentation

on:
push:
Expand Down Expand Up @@ -26,3 +26,4 @@ jobs:
key: ${{ secrets.MASSANET_SSHKEY }}
source: "./massa-web3"
target: "/var/www/type-doc"
port: 22000
29 changes: 29 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Integration tests

on:
workflow_call:
secrets:
PRIVATE_KEY:
required: true

jobs:
test:
uses: ./.github/workflows/unit-tests.yml
integration-tests:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- run: npm ci
- run: npm run build

- name: Run integration tests
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
run: npm run test:integration
49 changes: 0 additions & 49 deletions .github/workflows/massa-web3-code-snippets.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/massa-web3-deploy-test-smartContract.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: (workspace) Npm nightly publish
name: Npm nightly publish

on:
push:
branches: [main, buildnet]

jobs:
test:
uses: ./.github/workflows/workspace-check-formatting-and-run-tests.yml
integration-tests:
uses: ./.github/workflows/integration-tests.yml
secrets:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

publish-npm-dev:
needs: test
needs: integration-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: (workspace) NPM Publish
name: NPM Publish latest

on:
release:
types: [created]

jobs:
test:
uses: ./.github/workflows/workspace-check-formatting-and-run-tests.yml
integration-tests:
uses: ./.github/workflows/integration-tests.yml
secrets:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

publish-npm:
needs: test
needs: integration-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Npm publish next

on:
push:
branches: [next]

jobs:
integration-tests:
uses: ./.github/workflows/integration-tests.yml
secrets:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

publish-npm-next:
needs: integration-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: ./scripts/publish-next.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: (workspace) Check Formatting and Run Tests
name: Check Formatting and Run unit tests

on:
push:
workflow_call:

jobs:
Expand All @@ -18,4 +17,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run fmt:check
- run: npm test
- name: unit test
run: npm test
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
Loading

2 comments on commit afa381f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for experimental massa-web3

St.
Category Percentage Covered / Total
🟡 Statements 64.71% 1168/1805
🔴 Branches 46.43% 195/420
🔴 Functions 47.65% 213/447
🟡 Lines 65.01% 1161/1786

Test suite run success

132 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from afa381f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for experimental massa-web3

St.
Category Percentage Covered / Total
🟡 Statements 64.71% 1168/1805
🔴 Branches 46.43% 195/420
🔴 Functions 47.65% 213/447
🟡 Lines 65.01% 1161/1786

Test suite run success

132 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from afa381f

Please sign in to comment.