Skip to content

Commit e525633

Browse files
committed
fix: update workflow
1 parent 8319f3e commit e525633

4 files changed

Lines changed: 79 additions & 53 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -91,41 +91,25 @@ jobs:
9191
--health-retries 5
9292
9393
steps:
94-
- uses: actions/checkout@v4
94+
- uses: actions/checkout@v6
9595

96-
- name: Setup Node
97-
uses: actions/setup-node@v4
98-
with:
99-
node-version: 24
100-
101-
- name: Get yarn cache directory
102-
id: yarn-cache-dir-path
103-
run: |
104-
echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
105-
106-
- uses: actions/cache@v4
107-
with:
108-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
109-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
110-
restore-keys: |
111-
${{ runner.os }}-yarn-
96+
- name: Install Mise
97+
uses: jdx/mise-action@v3
11298

11399
- name: yarn install and build
114-
run: |
115-
yarn
116-
yarn build
100+
run: mise run build
117101

118102
- name: yarn check
119-
run: yarn check
103+
run: mise run check
120104

121105
- name: apply migrations on empty database
122-
run: yarn migration:run
106+
run: mise run migrate
123107

124108
- name: check migrations are up to date
125-
run: yarn migration:check
109+
run: mise run migration-check
126110

127111
- name: vitest tests
128-
run: yarn vitest
112+
run: mise run vitest
129113

130114
test-node:
131115
strategy:
@@ -170,24 +154,10 @@ jobs:
170154
--health-retries 5
171155
172156
steps:
173-
- uses: actions/checkout@v4
157+
- uses: actions/checkout@v6
174158

175-
- name: Setup Node
176-
uses: actions/setup-node@v4
177-
with:
178-
node-version: 24
179-
180-
- name: Get yarn cache directory
181-
id: yarn-cache-dir-path
182-
run: |
183-
echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
184-
185-
- uses: actions/cache@v4
186-
with:
187-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
188-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
189-
restore-keys: |
190-
${{ runner.os }}-yarn-
159+
- name: Install Mise
160+
uses: jdx/mise-action@v3
191161

192162
- uses: actions/cache@v4
193163
with:
@@ -196,12 +166,8 @@ jobs:
196166
restore-keys: |
197167
${{ runner.os }}-jest-
198168
199-
- name: yarn install
200-
run: |
201-
yarn
202-
203169
- name: apply migrations on empty database
204-
run: yarn migration:run
170+
run: mise run migrate
205171

206172
- name: yarn test
207-
run: yarn test:ci --shard=${{ matrix.shard }}
173+
run: mise run e2e --shard=${{ matrix.shard }}

mise.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ postinstall = 'npx corepack enable'
1010
# This must be enabled to make the hooks work
1111
experimental = true
1212

13+
[env]
14+
_.path = ['{{config_root}}/node_modules/.bin']
15+
1316
[tasks.pnpm-install]
1417
description = 'Installs dependencies with pnpm'
1518
run = 'pnpm install'
@@ -20,3 +23,46 @@ outputs = ['node_modules/.pnpm/lock.yaml']
2023
depends = ["pnpm-install"]
2124
description = "Run the development server"
2225
run = "pnpm watch"
26+
27+
[tasks.lint]
28+
depends = ["pnpm-install"]
29+
description = "Lint the files with eslint"
30+
run = "eslint '**/*.{js,ts}'"
31+
32+
[tasks.prettier-check]
33+
depends = ["pnpm-install"]
34+
description = "Check formatting with prettier"
35+
run = "prettier --check \"{src,test}/**/*.ts\""
36+
37+
[tasks.type-check]
38+
depends = ["pnpm-install"]
39+
description = "Run typescript checking"
40+
run = "tsc --noEmit"
41+
42+
[tasks.check]
43+
depends = ["prettier-check", "lint", "type-check"]
44+
45+
[tasks.build]
46+
depends = ["lint"]
47+
description = "Build the application"
48+
run = "tsc -p tsconfig.build.json"
49+
50+
[tasks.migrate]
51+
run = "drizzle-kit migrate"
52+
env = { _.file = '.env.development' }
53+
54+
[tasks.migration-check]
55+
env = { _.file = '.env.development' }
56+
depends = ["pnpm-install"]
57+
run = "drizzle-kit generate --name=migrationtest --out=./src/drizzle --schema=./src/drizzle/schema.ts --dialect=postgresql && [ -f '$(find ./src/drizzle | grep migrationtest)' ] && exit 1 || exit 0"
58+
59+
[tasks.vitest]
60+
depends = "pnpm-install"
61+
run = "vitest"
62+
63+
[tasks.e2e]
64+
depends = ["pnpm-install"]
65+
run = "jest --forceExit --verbose --coverage --silent --detectOpenHandles --maxWorkers=2"
66+
67+
[tasks.test]
68+
depends = ["vitest", "e2e"]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"openapi:report": "vacuum html-report ./openapi.json vacuum-report.html",
4343
"migration:apply-test": "DB_CONNECTION=postgres://test:test@db:5432/test yarn migration:run",
4444
"migration:generate": "yarn drizzle-kit generate",
45-
"migration:run": "yarn drizzle-kit migrate",
45+
"migrate": "drizzle-kit migrate",
4646
"migration:check": "yarn drizzle-kit generate --name=migrationtest --out=./src/drizzle --schema=./src/drizzle/schema.ts --dialect=postgresql && [ -f '$(find ./src/drizzle | grep migrationtest)' ] && exit 1 || exit 0",
4747
"db-doc:generate": "npx drizzle-kit export > schema.sql && npx @liam-hq/cli erd build --input schema.sql --format postgres --output-dir db-documentation"
4848
},

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)