Skip to content

Commit d3babd5

Browse files
committed
fix: ci and test
1 parent 0f32b75 commit d3babd5

File tree

7 files changed

+100
-12
lines changed

7 files changed

+100
-12
lines changed

.github/workflows/check1.yaml

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- develop
77
pull_request:
8+
workflow_dispatch:
89

910
jobs:
1011
quality-check:
@@ -24,17 +25,21 @@ jobs:
2425
node-version: 20
2526
cache: pnpm
2627

27-
- name: Cache deps
28-
uses: actions/cache@v3
28+
- name: Get pnpm store directory
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32+
33+
- name: Cache pnpm
34+
uses: actions/cache@v4
2935
with:
30-
path: |
31-
${{ github.workspace }}/.deps
32-
key: ${{ runner.os }}-deps-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
path: ${{ env.STORE_PATH }}
37+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3338
restore-keys: |
34-
${{ runner.os }}-deps-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
${{ runner.os }}-pnpm-store-
3540
3641
- name: Cache turbo tasks
37-
uses: actions/cache@v3
42+
uses: actions/cache@v4
3843
with:
3944
path: .turbo
4045
key: ${{ runner.os }}-turbo-${{ github.sha }}

gui/jest.config.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "jsdom",
5+
rootDir: "./",
6+
moduleNameMapper: {
7+
"^@gui/(.*)$": "<rootDir>/src/$1",
8+
},
9+
};

gui/package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"scripts": {
1515
"dev": "tsup --watch",
1616
"build": "tsup",
17+
"staged": "pnpm run typecheck && pnpm run format && pnpm run lint && pnpm run test",
1718
"typecheck": "tsc --noEmit",
19+
"test": "jest",
20+
"test:watch": "jest --watch",
1821
"lint": "eslint .",
1922
"lint:fix": "eslint . --fix",
2023
"format": "prettier --check .",
@@ -76,15 +79,18 @@
7679
"devDependencies": {
7780
"@libsqlstudio/tailwind": "workspace:*",
7881
"@libsqlstudio/tsconfig": "workspace:*",
79-
"eslint-config-libsqlstudio": "workspace:*",
8082
"@types/deep-equal": "^1.0.4",
8183
"@types/jest": "^29.5.11",
8284
"@types/react": "^18.2.66",
8385
"@types/react-dom": "^18.2.22",
8486
"@vitejs/plugin-react": "^4.2.1",
8587
"autoprefixer": "^10.4.19",
88+
"eslint-config-libsqlstudio": "workspace:*",
89+
"jest": "^29.7.0",
90+
"jest-environment-jsdom": "^29.7.0",
8691
"postcss": "^8.4.38",
8792
"tailwindcss": "^3.4.3",
93+
"ts-jest": "^29.1.2",
8894
"tsup": "^8.0.2",
8995
"vite": "^5.2.0",
9096
"vite-tsconfig-paths": "^4.3.2"

gui/tsconfig.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
},
99
"noImplicitReturns": false
1010
},
11-
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "*.js", "*.ts"],
11+
"include": [
12+
"**/*.ts",
13+
"**/*.tsx",
14+
".eslintrc.cjs",
15+
"*.js",
16+
"*.ts",
17+
"jest.config.cjs"
18+
],
1219
"exclude": ["node_modules", "dist"]
1320
}

pnpm-lock.yaml

+55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

studio/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": false,
55
"scripts": {
66
"dev": "next dev --turbo",
7-
"build": "npm run db:migrate && next build",
7+
"build": "pnpm run db:migrate && next build",
88
"start": "next start",
99
"tsc": "tsc --noEmit --skipLibCheck",
1010
"test": "jest",
@@ -13,7 +13,7 @@
1313
"db:generate": "drizzle-kit generate:sqlite",
1414
"db:migrate": "tsx src/db/migrate.ts",
1515
"generate-random-key": "tsx src/cli/generate-aes-key.ts",
16-
"staged": "npm run tsc && npm run lint && jest",
16+
"staged": "pnpm run typecheck && pnpm run lint && jest",
1717
"typecheck": "tsc --noEmit --skipLibCheck",
1818
"format": "prettier --check .",
1919
"format:fix": "prettier --write .",

turbo.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
"test": { "cache": true },
2020
"test:watch": { "persistent": true, "cache": false },
2121
"staged": {
22-
"dependsOn": ["^format", "^lint", "^typecheck", "^test"]
22+
"dependsOn": [
23+
"@libsqlstudio/gui#build",
24+
"^format",
25+
"^lint",
26+
"^typecheck",
27+
"^test"
28+
]
2329
}
2430
}
2531
}

0 commit comments

Comments
 (0)