-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge main and update massa-web3 (#496)
- Loading branch information
Showing
161 changed files
with
15,758 additions
and
13,598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ node_modules | |
.github | ||
bundle.* | ||
docs | ||
dist | ||
webpack.config.js | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module.exports = { | ||
extends: ['@massalabs'], | ||
extends: ["@massalabs"], | ||
rules: { | ||
'tsdoc/syntax': 'warn', | ||
'max-len': ['error', 200], | ||
camelcase: 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
"tsdoc/syntax": "warn", | ||
"max-len": ["error", 200], | ||
camelcase: "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
name: Generate Powered-By | ||
name: Generate code snippets | ||
|
||
on: | ||
push: | ||
branches: | ||
- noPush | ||
branches: [ main ] | ||
|
||
|
||
|
||
jobs: | ||
generate-powered-by: | ||
generate-code-snippets: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
|
@@ -25,24 +27,23 @@ jobs: | |
node-version: 18 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Install license-report and jq | ||
- name: Install project dependencies | ||
run: | | ||
sudo apt-get update -y && sudo apt-get install -y jq | ||
sudo npm install -g license-report | ||
npm i | ||
- name: Install project dependencies | ||
- name: Generate code snippets | ||
run: | | ||
npm ci | ||
node scripts/transform-code-snippet-tests.mjs | ||
- name: Generate Powered-By | ||
- name: Format code snippets | ||
run: | | ||
./scripts/generate_powered-by.sh | ||
npm run prettier:fix | ||
- name: Commit Changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
token: ${{ secrets.MASSABOTCLASSIC }} | ||
commit_message: "Generate powered-by" | ||
file_pattern: "powered-by.md" | ||
token: | ||
commit_message: "Generate code snippets" | ||
file_pattern: "code-snippets/*" | ||
# Commit code using massabot account that can bypass push and MR restriction | ||
commit_author: massabot <[email protected]> | ||
commit_author: massabot <[email protected]> |
51 changes: 51 additions & 0 deletions
51
.github/workflows/massa-web3-deploy-test-smartContract.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: (massa-web3) Smart contract example Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
deploy-SC-example: | ||
defaults: | ||
run: | ||
working-directory: ./packages/massa-web3/examples/smartContracts/ | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: "npm" | ||
cache-dependency-path: ./packages/massa-web3/examples/smartContracts/contracts/package-lock.json | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
working-directory: ./ | ||
|
||
- name: Build workspace | ||
run: | | ||
npm run build | ||
working-directory: ./ | ||
|
||
- name: Deploy | ||
run: | | ||
echo ${{ secrets.JSON_RPC_URL_PUBLIC }} | ||
if npm run test-smart-contract-example ; then | ||
echo "Contracts successfully deployed!" | ||
else | ||
echo "Failed to deploy contracts ..." | ||
exit 1 | ||
fi | ||
env: | ||
JSON_RPC_URL_PUBLIC: https://buildnet.massa.net/api/v2 | ||
|
||
JSON_RPC_URL_PRIVATE: https://buildnet.massa.net/api/v2 | ||
|
||
DEPLOYER_PRIVATE_KEY: S12srNEAvZrTb9pktYeuePpuM4taW5dfmWAZYtdqyETWTBspkoT1 | ||
RECEIVER_PRIVATE_KEY: S1ykLaxXyMnJoaWLYds8UntqKTamZ4vcxrZ1fdToR8WpWEpk3FC |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
.github/workflows/workspace-check-formatting-and-run-tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: (workspace) Check Formatting and Run Tests | ||
|
||
on: | ||
push: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
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 | ||
- run: npm run fmt:check | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: (workspace) Coverage | ||
|
||
on: | ||
push: | ||
branches: [paused] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
project: [massa-web3, web3-utils] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
# https://github.com/actions/checkout/issues/298#issuecomment-664976337 | ||
ref: ${{ github.head_ref }} | ||
# Checkout code using massabot account | ||
token: ${{ secrets.MASSABOTCLASSIC || github.token }} | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "npm" | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
working-directory: ./ | ||
|
||
- name: Build workspace | ||
run: | | ||
npm run build | ||
working-directory: ./ | ||
|
||
- name: allow access to coverage.sh | ||
run: chmod +x ./scripts/coverage.sh | ||
shell: bash | ||
|
||
- name: Extract coverage | ||
id: coverage | ||
run: | | ||
value=$(npm run test:cov -w @massalabs/${{ matrix.project }} | awk '/All files/ {print $10}' | tr -d '%') | ||
echo "coverage=$value" >> $GITHUB_OUTPUT | ||
- name: Add test coverage to README | ||
run: ./scripts/coverage.sh | ||
shell: bash | ||
env: | ||
COVERAGE: ${{ steps.coverage.outputs.coverage }} | ||
PROJECT: ${{ matrix.project }} | ||
|
||
- name: Check if coverage changed | ||
id: check_coverage_changed | ||
run: | | ||
echo "::set-output name=coverage_changed::$(git diff --name-only README.md | grep -E '^README.md$')" | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
if: ${{ steps.check_coverage_changed.outputs.coverage_changed != '' }} | ||
with: | ||
commit_message: "Generate coverage badge" | ||
file_pattern: "README.md" | ||
# Commit code using massabot account that can bypass push and MR restriction | ||
commit_author: massabot <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: (workspace) Deploy documentation | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
deploy-typedoc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Generate doc | ||
run: | | ||
npm ci | ||
npm run doc | ||
mv docs/documentation/html massa-web3 | ||
- name: Deploy files | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.MASSANET_HOST }} | ||
username: ${{ secrets.MASSANET_USERNAME }} | ||
key: ${{ secrets.MASSANET_SSHKEY }} | ||
source: "./massa-web3" | ||
target: "/var/www/type-doc" |
Oops, something went wrong.