Skip to content
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "ci"

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
test:
name: run sdk tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: checkout code
uses: actions/checkout@v4

- name: setup node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: installing dependencies
run: npm ci

- name: run tests
run: npm run test:ci
env:
WHITELISTED_WALLET_PRIVATE_KEY: ${{ secrets.WHITELISTED_WALLET_PRIVATE_KEY }}
SELLER_ENTITY_ID: ${{ secrets.SELLER_ENTITY_ID }}
SELLER_AGENT_WALLET_ADDRESS: ${{ secrets.SELLER_AGENT_WALLET_ADDRESS }}

- name: uploads results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results-${{ matrix.node-version }}
path: junit.xml
22 changes: 22 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "test report"
on:
workflow_run:
workflows: ["CI"]
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v2
with:
artifact: test-results
name: JEST Tests
path: "*.xml"
reporter: jest-junit
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"types": "./dist/index.d.ts",
"scripts": {
"test": "jest",
"test:ci": "jest --ci --reporters=default --reporters=jest-junit",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"tsup": "tsup src/index.ts --dts --format cjs,esm --out-dir dist"
Expand All @@ -21,6 +22,7 @@
"babel-jest": "^30.2.0",
"dotenv": "^17.2.3",
"jest": "^30.2.0",
"jest-junit": "^16.0.0",
"ts-jest": "^29.4.5",
"typescript": "^5.8.3"
},
Expand Down