Skip to content

Commit ba76834

Browse files
committed
ci(ci-cd): add missing env vars for unit tests
1 parent 884037b commit ba76834

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ jobs:
5050
- name: pnpm install
5151
uses: falcondev-it/.github/actions/pnpm-install@master
5252

53-
- run: VITEST_DB_DRIVER=${{ matrix.db-driver }} VITEST_STORAGE_DRIVER=${{ matrix.storage-driver }} pnpm run test:run
53+
- run: touch mock.key
54+
- run: touch mock.crt
55+
56+
- run: pnpm run test:run
57+
env:
58+
VITEST_DB_DRIVER: ${{ matrix.db-driver }}
59+
VITEST_STORAGE_DRIVER: ${{ matrix.storage-driver }}
60+
DISABLE_PROXY: true
61+
CA_CERT_PATH: mock.crt
62+
CA_KEY_PATH: mock.key
5463

5564
deploy:
5665
if: github.event.ref == 'refs/heads/dev'

lib/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const envSchema = z.object({
1818
CA_KEY_PATH: z.string(),
1919
CA_CERT_PATH: z.string(),
2020
TEMP_DIR: z.string().default(tmpdir()),
21+
DISABLE_PROXY: booleanSchema.default('false'),
2122
})
2223

2324
const parsedEnv = envSchema.safeParse(process.env)

lib/proxy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { ENV } from './env'
33
import { logger } from './logger'
44

55
export async function initializeProxy() {
6+
if (ENV.DISABLE_PROXY) {
7+
logger.warn('Proxy is disabled')
8+
return
9+
}
10+
611
const port = ENV.PROXY_PORT
712
logger.info(`Starting proxy server on port ${port}...`)
813

0 commit comments

Comments
 (0)