Skip to content

Commit bc4eaa6

Browse files
committed
fix: update CI to use Node.js 20 and fix SDK test typing
1 parent 5c36165 commit bc4eaa6

File tree

3 files changed

+68
-43
lines changed

3 files changed

+68
-43
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
88

99
jobs:
1010
lint:
1111
name: Lint
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
15+
1616
- name: Setup Node.js
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: '18'
19+
node-version: '20'
2020
cache: 'npm'
21-
21+
2222
- name: Install dependencies
2323
run: npm ci
24-
24+
2525
- name: Run ESLint
2626
run: npm run lint
27-
27+
2828
- name: Run Prettier
2929
run: npm run format:check
30-
30+
3131
- name: Run Solhint
3232
run: npx solhint 'contracts/**/*.sol'
3333

@@ -36,25 +36,25 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v3
39-
39+
4040
- name: Setup Node.js
4141
uses: actions/setup-node@v3
4242
with:
43-
node-version: '18'
43+
node-version: '20'
4444
cache: 'npm'
45-
45+
4646
- name: Install dependencies
4747
run: npm ci
48-
48+
4949
- name: Compile contracts
5050
run: npx hardhat compile
51-
51+
5252
- name: Run contract tests
5353
run: npx hardhat test
54-
54+
5555
- name: Generate coverage report
5656
run: npx hardhat coverage
57-
57+
5858
- name: Upload coverage to Codecov
5959
uses: codecov/codecov-action@v3
6060
with:
@@ -66,23 +66,23 @@ jobs:
6666
runs-on: ubuntu-latest
6767
steps:
6868
- uses: actions/checkout@v3
69-
69+
7070
- name: Setup Node.js
7171
uses: actions/setup-node@v3
7272
with:
73-
node-version: '18'
73+
node-version: '20'
7474
cache: 'npm'
75-
75+
7676
- name: Install dependencies
7777
run: |
7878
cd backend
7979
npm ci
80-
80+
8181
- name: Run backend tests
8282
run: |
8383
cd backend
8484
npm test
85-
85+
8686
- name: Upload coverage to Codecov
8787
uses: codecov/codecov-action@v3
8888
with:
@@ -94,18 +94,18 @@ jobs:
9494
runs-on: ubuntu-latest
9595
steps:
9696
- uses: actions/checkout@v3
97-
97+
9898
- name: Setup Node.js
9999
uses: actions/setup-node@v3
100100
with:
101-
node-version: '18'
101+
node-version: '20'
102102
cache: 'npm'
103-
103+
104104
- name: Install dependencies
105105
run: |
106106
cd sdk
107107
npm ci
108-
108+
109109
- name: Run SDK tests
110110
run: |
111111
cd sdk
@@ -116,20 +116,20 @@ jobs:
116116
runs-on: ubuntu-latest
117117
steps:
118118
- uses: actions/checkout@v3
119-
119+
120120
- name: Setup Node.js
121121
uses: actions/setup-node@v3
122122
with:
123-
node-version: '18'
123+
node-version: '20'
124124
cache: 'npm'
125-
125+
126126
- name: Install dependencies
127127
run: npm ci
128-
128+
129129
- name: Run npm audit
130130
run: npm audit --audit-level=moderate
131131
continue-on-error: true
132-
132+
133133
- name: Run Slither (Smart Contract Security)
134134
uses: crytic/slither-action@v0.3.0
135135
continue-on-error: true
@@ -143,31 +143,31 @@ jobs:
143143
needs: [lint, test-contracts, test-backend, test-sdk]
144144
steps:
145145
- uses: actions/checkout@v3
146-
146+
147147
- name: Setup Node.js
148148
uses: actions/setup-node@v3
149149
with:
150-
node-version: '18'
150+
node-version: '20'
151151
cache: 'npm'
152-
152+
153153
- name: Install dependencies
154154
run: npm ci
155-
155+
156156
- name: Build contracts
157157
run: npx hardhat compile
158-
158+
159159
- name: Build backend
160160
run: |
161161
cd backend
162162
npm ci
163163
npm run build
164-
164+
165165
- name: Build SDK
166166
run: |
167167
cd sdk
168168
npm ci
169169
npm run build
170-
170+
171171
- name: Build frontend
172172
run: |
173173
cd frontend

backend/package-lock.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/src/index.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { KubernaSDK } from '../src/index';
22
import axios from 'axios';
33

4-
jest.mock('axios');
5-
const mockedAxios = axios as jest.Mocked<typeof axios>;
4+
const mockedAxios = jest.mocked(axios);
65

76
describe('KubernaSDK', () => {
87
const config = {
@@ -23,10 +22,12 @@ describe('KubernaSDK', () => {
2322

2423
const result = await sdk.request('GET', '/test');
2524
expect(result).toEqual(mockData);
26-
expect(mockedAxios).toHaveBeenCalledWith(expect.objectContaining({
27-
method: 'GET',
28-
url: `${config.baseUrl}/test`,
29-
headers: { 'X-API-KEY': config.apiKey },
30-
}));
25+
expect(mockedAxios).toHaveBeenCalledWith(
26+
expect.objectContaining({
27+
method: 'GET',
28+
url: `${config.baseUrl}/test`,
29+
headers: { 'X-API-KEY': config.apiKey },
30+
})
31+
);
3132
});
3233
});

0 commit comments

Comments
 (0)