chore(web3): use github actions (#19816)
* chore: use github actions * chore: npm audit * chore: fix prettier warn * chore: fix doc errors * chore: add puppeteer
This commit is contained in:
parent
e1a038e791
commit
1942d294e9
|
@ -0,0 +1,58 @@
|
|||
name: Web3
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- "web3.js/**"
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- "web3.js/**"
|
||||
|
||||
jobs:
|
||||
check-web3:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: web3.js
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node: [ '12', '14', '16' ]
|
||||
|
||||
name: Node ${{ matrix.node }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# maybe needed for base sha below
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: web3.js/package-lock.json
|
||||
- run: npm i -g npm@7
|
||||
- run: npm ci
|
||||
- name: commit-lint
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: bash commitlint.sh
|
||||
env:
|
||||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||
- run: npm run lint
|
||||
- run: |
|
||||
npm run build
|
||||
ls -l lib
|
||||
test -r lib/index.iife.js
|
||||
test -r lib/index.cjs.js
|
||||
test -r lib/index.esm.js
|
||||
- run: npm run doc
|
||||
- run: npm run codecov
|
||||
- run: |
|
||||
sh -c "$(curl -sSfL https://release.solana.com/edge/install)"
|
||||
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
|
||||
PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
|
||||
solana --version
|
||||
- run: npm run test:live-with-test-validator
|
||||
- run: npm run test:browser-with-test-validator
|
24
.travis.yml
24
.travis.yml
|
@ -67,30 +67,6 @@ jobs:
|
|||
# before_install:
|
||||
# - sudo apt-get install libssl-dev libudev-dev
|
||||
|
||||
# web3.js pull request
|
||||
- name: "web3.js"
|
||||
if: type = pull_request AND branch = master
|
||||
|
||||
language: node_js
|
||||
node_js:
|
||||
- "lts/*"
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- ~/.npm
|
||||
|
||||
before_install:
|
||||
- .travis/affects.sh web3.js/ .travis || travis_terminate 0
|
||||
- cd web3.js/
|
||||
- source .travis/before_install.sh
|
||||
|
||||
script:
|
||||
- ../.travis/commitlint.sh
|
||||
- source .travis/script.sh
|
||||
|
||||
# docs pull request
|
||||
- name: "docs"
|
||||
if: type IN (push, pull_request) OR tag IS present
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
arrowParens: "avoid"
|
||||
bracketSpacing: false
|
||||
jsxBracketSameLine: false
|
||||
semi: true
|
||||
singleQuote: true
|
||||
tabWidth: 2
|
||||
|
|
|
@ -38,6 +38,7 @@ deploy:
|
|||
on:
|
||||
branch: master
|
||||
node_js: "lts/*"
|
||||
|
||||
- provider: script
|
||||
skip_cleanup: true
|
||||
script:
|
||||
|
@ -45,6 +46,7 @@ deploy:
|
|||
on:
|
||||
branch: master
|
||||
node_js: "lts/*"
|
||||
|
||||
- provider: releases
|
||||
skip-cleanup: true
|
||||
file:
|
||||
|
|
|
@ -20,13 +20,13 @@ if [[ ! -f "$basedir"/commitlint.config.js ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $TRAVIS_COMMIT_RANGE ]]; then
|
||||
echo "Error: TRAVIS_COMMIT_RANGE not defined"
|
||||
if [[ -z $COMMIT_RANGE ]]; then
|
||||
echo "Error: COMMIT_RANGE not defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$basedir"
|
||||
echo "Checking commits in TRAVIS_COMMIT_RANGE: $TRAVIS_COMMIT_RANGE"
|
||||
echo "Checking commits in COMMIT_RANGE: $COMMIT_RANGE"
|
||||
while IFS= read -r line; do
|
||||
echo "$line" | npx commitlint
|
||||
done < <(git log "$TRAVIS_COMMIT_RANGE" --format=%s -- .)
|
||||
done < <(git log "$COMMIT_RANGE" --format=%s -- .)
|
File diff suppressed because it is too large
Load Diff
|
@ -43,7 +43,7 @@
|
|||
"clean": "rimraf ./coverage ./lib",
|
||||
"codecov": "set -ex; npm run test:cover; cat ./coverage/lcov.info | codecov",
|
||||
"dev": "cross-env NODE_ENV=development rollup -c",
|
||||
"doc": "set -ex; typedoc",
|
||||
"doc": "set -ex; typedoc --treatWarningsAsErrors",
|
||||
"flow:check": "flow check-contents < module.flow.js",
|
||||
"flow:gen": "flowgen lib/index.d.ts -o module.flow.js",
|
||||
"type:gen": "./scripts/typegen.sh",
|
||||
|
@ -126,6 +126,7 @@
|
|||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier": "^2.3.0",
|
||||
"puppeteer": "^10.2.0",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.56.3",
|
||||
"rollup-plugin-dts": "^4.0.0",
|
||||
|
|
|
@ -12,7 +12,10 @@ import {toBuffer} from './util/to-buffer';
|
|||
*/
|
||||
export const MAX_SEED_LENGTH = 32;
|
||||
|
||||
type PublicKeyInitData =
|
||||
/**
|
||||
* Value to be converted into public key
|
||||
*/
|
||||
export type PublicKeyInitData =
|
||||
| number
|
||||
| string
|
||||
| Buffer
|
||||
|
@ -20,7 +23,10 @@ type PublicKeyInitData =
|
|||
| Array<number>
|
||||
| PublicKeyData;
|
||||
|
||||
type PublicKeyData = {
|
||||
/**
|
||||
* JSON object representation of PublicKey class
|
||||
*/
|
||||
export type PublicKeyData = {
|
||||
/** @internal */
|
||||
_bn: BN;
|
||||
};
|
||||
|
|
|
@ -106,7 +106,7 @@ export type SignaturePubkeyPair = {
|
|||
* List of Transaction object fields that may be initialized at construction
|
||||
*
|
||||
*/
|
||||
type TransactionCtorFields = {
|
||||
export type TransactionCtorFields = {
|
||||
/** A recent blockhash */
|
||||
recentBlockhash?: Blockhash | null;
|
||||
/** Optional nonce information used for offline nonce'd transactions */
|
||||
|
@ -120,7 +120,7 @@ type TransactionCtorFields = {
|
|||
/**
|
||||
* Nonce information to be used to build an offline Transaction.
|
||||
*/
|
||||
type NonceInformation = {
|
||||
export type NonceInformation = {
|
||||
/** The current blockhash stored in the nonce */
|
||||
nonce: Blockhash;
|
||||
/** AdvanceNonceAccount Instruction */
|
||||
|
|
Loading…
Reference in New Issue