Skip to content

Commit f6bd4de

Browse files
[js-legacy-client] Set up CI (#24)
* set up ci for js-legacy client * fix deploy path after program build
1 parent 5198bfb commit f6bd4de

18 files changed

+1256
-128
lines changed

.github/workflows/main.yml

+39-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ jobs:
2626
- name: Lint Programs
2727
run: pnpm programs:lint
2828

29+
format_and_lint_client_js_legacy:
30+
name: Format & Lint Client JS Legacy
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Git Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Environment
37+
uses: ./.github/actions/setup
38+
39+
- name: Format Client JS Legacy
40+
run: pnpm clients:js-legacy:format
41+
42+
- name: Lint Client JS Legacy
43+
run: pnpm clients:js-legacy:lint
44+
2945
audit_rust:
3046
name: Audit Rust
3147
runs-on: ubuntu-latest
@@ -113,7 +129,7 @@ jobs:
113129
- name: Save Program Builds For Client Jobs
114130
uses: actions/cache/save@v4
115131
with:
116-
path: ./**/*.so
132+
path: ./target/deploy/*.so
117133
key: ${{ runner.os }}-builds-${{ github.sha }}
118134

119135
test_programs:
@@ -133,3 +149,25 @@ jobs:
133149

134150
- name: Test Programs
135151
run: pnpm programs:test
152+
153+
test_client_js_legacy:
154+
name: Test Client JS Legacy
155+
runs-on: ubuntu-latest
156+
needs: [format_and_lint_client_js_legacy, build_programs]
157+
steps:
158+
- name: Git Checkout
159+
uses: actions/checkout@v4
160+
161+
- name: Setup Environment
162+
uses: ./.github/actions/setup
163+
with:
164+
solana: true
165+
166+
- name: Restore Program Builds
167+
uses: actions/cache/restore@v4
168+
with:
169+
path: ./target/deploy/*.so
170+
key: ${{ runner.os }}-builds-${{ github.sha }}
171+
172+
- name: Test Client JS Legacy
173+
run: pnpm clients:js-legacy:test

clients/js-legacy/.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test-ledger
2+
3+
package-lock.json

clients/js-legacy/.eslintrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:prettier/recommended",
7+
"plugin:require-extensions/recommended"
8+
],
9+
"parser": "@typescript-eslint/parser",
10+
"plugins": [
11+
"@typescript-eslint",
12+
"prettier",
13+
"require-extensions"
14+
],
15+
"rules": {
16+
"@typescript-eslint/ban-ts-comment": "off",
17+
"@typescript-eslint/no-explicit-any": "off",
18+
"@typescript-eslint/no-unused-vars": "off",
19+
"@typescript-eslint/no-empty-interface": "off",
20+
"@typescript-eslint/consistent-type-imports": "error"
21+
},
22+
"overrides": [
23+
{
24+
"files": [
25+
"examples/**/*",
26+
"test/**/*"
27+
],
28+
"rules": {
29+
"require-extensions/require-extensions": "off",
30+
"require-extensions/require-index": "off"
31+
}
32+
}
33+
]
34+
}

clients/js-legacy/package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"lint:fix": "eslint --fix .",
1919
"format": "prettier --check src test",
2020
"format:fix": "prettier --write src test",
21-
"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'"
21+
"test": "mocha test/*"
2222
},
2323
"peerDependencies": {
2424
"@solana/web3.js": "^1.95.5"
@@ -27,15 +27,22 @@
2727
"@solana/codecs-numbers": "^2.0.0"
2828
},
2929
"devDependencies": {
30+
"@solana/prettier-config-solana": "0.0.5",
31+
"@eslint/js": "^9.19.0",
3032
"@types/chai": "^5.0.1",
3133
"@types/node": "^22.10.1",
3234
"@types/mocha": "^10.0.10",
3335
"chai": "^5.1.2",
36+
"eslint": "^8.57.1",
37+
"eslint-config-prettier": "^10.0.1",
38+
"eslint-plugin-prettier": "^5.2.3",
39+
"eslint-plugin-require-extensions": "^0.1.1",
3440
"mocha": "^11.0.1",
3541
"prettier": "^3.4.2",
3642
"typescript": "^5.7.2",
3743
"start-server-and-test": "^2.0.8",
38-
"ts-node": "^10.9.2"
44+
"ts-node": "^10.9.2",
45+
"typescript-eslint": "^8.22.0"
3946
},
4047
"prettier": "@solana/prettier-config-solana"
4148
}

0 commit comments

Comments
 (0)