Skip to content

Commit

Permalink
Merge pull request #403 from casper-ecosystem/feat-3.0-scratch
Browse files Browse the repository at this point in the history
Feat 3.0 scratch
  • Loading branch information
hoffmannjan authored Apr 11, 2024
2 parents e74c611 + ef9c656 commit 301ea78
Show file tree
Hide file tree
Showing 88 changed files with 10,527 additions and 12,191 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
// If you don't want to extend any rules, you don't need an `extends` attribute.
extends: ['plugin:@typescript-eslint/recommended'],
parserOptions: {
project: ['./tsconfig.json'] // Specify it only for TypeScript files
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json']
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
38 changes: 28 additions & 10 deletions .github/workflows/ci-casper-client-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [16.x, 18.x]
os: [ubuntu-20.04, ubuntu-22.04]
node-version: [18.x]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
env:
FAUCET_PRIV_KEY: 'MC4CAQAwBQYDK2VwBCIEII8ULlk1CJ12ZQ+bScjBt/IxMAZNggClWqK56D1/7CbI' #ci/test-assets/secret-key.pem
Expand All @@ -47,52 +47,70 @@ jobs:
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'yarn'

# https://github.com/dtinth/setup-github-actions-caching-for-turbo
- name: Setup Turbo cache server
uses: dtinth/setup-github-actions-caching-for-turbo@e26dc6b0473cc072107f6cb4f6e69d33ac2fc386 # v1.1.0

- name: Install
run: npm install
run: yarn install

- name: Audits
run: npm audit --omit=dev
run: yarn npm audit --environment production

- name: Lints
run: npm run lint:ci
run: yarn lint:ci

- name: Unit Test
run: npm run test:unit
run: yarn test

- name: Generate coverage report
run: yarn test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Test docs build
run: npm run docs:build
run: yarn docs:build

- name: Test build
run: npm run build
run: yarn build

# test mainnet
- name: Get the mainnet version
if: ${{ false }}
id: get-mainnet-version
run: echo "MAINNET_VERSION=$(curl -s -X POST --data-raw '${{ env.VERSION_QUERY }}' -H "Content-Type:application/json" ${{ env.MAINNET_NODE_URL }} | jq -r .result.build_version | cut -d "-" -f 1)" >> "$GITHUB_ENV"

- name: Test RPC - mainnet ${{ env.MAINNET_VERSION }}
if: ${{ false }}
run: npx casper-node-launcher-js node v${{ env.MAINNET_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop

# test testnet
- name: Get the testnet version
if: ${{ false }}
id: get-testnet-version
run: echo "TESTNET_VERSION=$(curl -s -X POST --data-raw '${{ env.VERSION_QUERY }}' -H "Content-Type:application/json" ${{ env.TESTNET_NODE_URL }} | jq -r .result.build_version | cut -d "-" -f 1)" >> "$GITHUB_ENV"

- name: Test RPC - testnet ${{ env.TESTNET_VERSION }}
if: ${{ false }}
run: npx casper-node-launcher-js node v${{ env.TESTNET_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop

- name: Get Latest Casper-Node Tag Version
if: ${{ false }}
run: |
echo "CASPER_TAG_VERSION=$(curl -s ${{ env.GH_API_URL }} | jq -r '.[].name' | grep 'v*' | sort -V | sed 's/_$//' | tail -n1)" >> $GITHUB_ENV
env:
GH_API_URL: 'https://api.github.com/repos/casper-network/casper-node/tags'

- name: Test RPC - Casper Node - ${{ env.CASPER_TAG_VERSION }}
# Runs action if the latest version is different from mainnet and testnet
if: ${{ env.CASPER_TAG_VERSION }} != v${{ env.MAINNET_VERSION }} && ${{ env.CASPER_TAG_VERSION }} != v${{ env.TESTNET_VERSION }}
if: ${{ false }} # && ${{ env.CASPER_TAG_VERSION }} != v${{ env.MAINNET_VERSION }} && ${{ env.CASPER_TAG_VERSION }} != v${{ env.TESTNET_VERSION }}
run: npx casper-node-launcher-js node ${{ env.CASPER_TAG_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop

- name: Test RPC - Casper Node - DEV
if: ${{ false }}
run: npx casper-node-launcher-js node dev --daemon && npm run test:e2e && npx casper-node-launcher-js stop
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ node_modules

# Output
/docs/
/dist/
dist/
.turbo

.eslintcache
.nyc_output
coverage

.DS_Store

.env
.env

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.1.cjs
33 changes: 33 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
coverage:
status:
project:
default:
target: 80%
threshold: 1%
patch:
default:
target: auto
threshold: 5%

component_management:
default_rules: # default rules that will be inherited by all components
statuses:
- type: project
target: 80%
- type: patch
target: 80%

individual_components:
- component_id: '@casper-js-sdk/types'
paths:
- /packages/types/src/
- component_id: '@casper-js-sdk/keys'
paths:
- /packages/keys/src/

comment:
layout: 'header, diff, flags, components'
behavior: 'default'
require_changes: false
require_base: no
require_head: no
31 changes: 0 additions & 31 deletions karma.conf.js

This file was deleted.

Loading

0 comments on commit 301ea78

Please sign in to comment.