Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js-legacy-client] Set up CI #24

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ jobs:
- name: Lint Programs
run: pnpm programs:lint

format_and_lint_client_js_legacy:
name: Format & Lint Client JS Legacy
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup

- name: Format Client JS Legacy
run: pnpm clients:js-legacy:format

- name: Lint Client JS Legacy
run: pnpm clients:js-legacy:lint

audit_rust:
name: Audit Rust
runs-on: ubuntu-latest
Expand Down Expand Up @@ -113,7 +129,7 @@ jobs:
- name: Save Program Builds For Client Jobs
uses: actions/cache/save@v4
with:
path: ./**/*.so
path: ./target/deploy/*.so
key: ${{ runner.os }}-builds-${{ github.sha }}

test_programs:
Expand All @@ -133,3 +149,25 @@ jobs:

- name: Test Programs
run: pnpm programs:test

test_client_js_legacy:
name: Test Client JS Legacy
runs-on: ubuntu-latest
needs: [format_and_lint_client_js_legacy, build_programs]
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
solana: true

- name: Restore Program Builds
uses: actions/cache/restore@v4
with:
path: ./target/deploy/*.so
key: ${{ runner.os }}-builds-${{ github.sha }}

- name: Test Client JS Legacy
run: pnpm clients:js-legacy:test
3 changes: 3 additions & 0 deletions clients/js-legacy/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test-ledger

package-lock.json
34 changes: 34 additions & 0 deletions clients/js-legacy/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:require-extensions/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier",
"require-extensions"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/consistent-type-imports": "error"
},
"overrides": [
{
"files": [
"examples/**/*",
"test/**/*"
],
"rules": {
"require-extensions/require-extensions": "off",
"require-extensions/require-index": "off"
}
}
]
}
11 changes: 9 additions & 2 deletions clients/js-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:fix": "eslint --fix .",
"format": "prettier --check src test",
"format:fix": "prettier --write src test",
"test": "start-server-and-test 'solana-test-validator --bpf-program recr1L3PCGKLbckBqMNcJhuuyU1zgo8nBhfLVsJNwr5 ../../target/deploy/spl_record.so --reset --quiet' http://127.0.0.1:8899/health 'mocha test'"
"test": "mocha test/*"
},
"peerDependencies": {
"@solana/web3.js": "^1.95.5"
Expand All @@ -27,15 +27,22 @@
"@solana/codecs-numbers": "^2.0.0"
},
"devDependencies": {
"@solana/prettier-config-solana": "0.0.5",
"@eslint/js": "^9.19.0",
"@types/chai": "^5.0.1",
"@types/node": "^22.10.1",
"@types/mocha": "^10.0.10",
"chai": "^5.1.2",
"eslint": "^8.57.1",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-require-extensions": "^0.1.1",
"mocha": "^11.0.1",
"prettier": "^3.4.2",
"typescript": "^5.7.2",
"start-server-and-test": "^2.0.8",
"ts-node": "^10.9.2"
"ts-node": "^10.9.2",
"typescript-eslint": "^8.22.0"
},
"prettier": "@solana/prettier-config-solana"
}
Loading
Loading