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

jobs:
unit-test:
runs-on: ubuntu-latest
environment: test

env:
PORT: 4000
SUPABASE_CACHING_DB_URL: "https://test.supabase.com"
SUPABASE_CACHING_ANON_API_KEY: "test"
SUPABASE_DATA_DB_URL: "https://test.supabase.com"
SUPABASE_DATA_SERVICE_API_KEY: "test"
KEY: "test"
PROOF: "test"

ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
DRPC_API_KEY: "test"
INFURA_API_KEY: "test"

INDEXER_ENVIRONMENT: "test"

CACHING_DATABASE_URL: "https://test.supabase.com"
DATA_DATABASE_URL: "https://test.supabase.com"

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: "20.x"

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install dependencies
run: pnpm install

- name: "Run unit tests"
run: pnpm test:coverage
- name: "Report Coverage"
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"preintegration": "pnpm --dir ./lib/hypercerts-indexer i",
"lint": "eslint",
"test": "vitest",
"test:coverage": "vitest --coverage.enabled true",
"prepare": "husky",
"commitlint": "commitlint --config commitlintrc.ts --edit"
},
Expand Down Expand Up @@ -98,6 +99,7 @@
"@types/pg": "^8.11.6",
"@types/sinon": "^17.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@vitest/coverage-v8": "^2.1.8",
"chai": "^5.0.0",
"chai-assertions-count": "^1.0.2",
"concurrently": "^8.2.2",
Expand All @@ -119,7 +121,9 @@
"typedoc": "^0.26.5",
"typescript": "5.5.3",
"typescript-eslint": "^7.7.0",
"vitest": "^1.1.3"
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8",
"vitest-mock-extended": "^2.0.2"
},
"lint-staged": {
"*.{mjx,cjs,js,jsx,ts,tsx}": [
Expand Down
Loading
Loading