-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from kimitrii/kimitri
Refactor GitHub Actions to Run Tests Using cloudflare/wrangler-action@v3 and Remove wrangler.toml
- Loading branch information
Showing
6 changed files
with
53 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,7 @@ pnpm-debug.log* | |
lerna-debug.log* | ||
|
||
# misc | ||
.DS_Store | ||
.DS_Store | ||
|
||
# cloudflare | ||
wrangler.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import { defineWorkersConfig, readD1Migrations } from "@cloudflare/vitest-pool-workers/config"; | ||
import { | ||
defineWorkersConfig, | ||
readD1Migrations | ||
} from '@cloudflare/vitest-pool-workers/config' | ||
|
||
export default defineWorkersConfig(async () => { | ||
const migrations = await readD1Migrations("./src/migrations") | ||
return { | ||
test: { | ||
globals: true, | ||
poolOptions: { | ||
workers: { | ||
isolatedStorage: true, | ||
miniflare: { | ||
bindings: { | ||
TEST_MIGRATIONS: migrations | ||
} | ||
}, | ||
wrangler: { | ||
configPath: "./wrangler.toml" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
const migrations = await readD1Migrations('./src/migrations') | ||
return { | ||
test: { | ||
globals: true, | ||
poolOptions: { | ||
workers: { | ||
isolatedStorage: true, | ||
miniflare: { | ||
d1Databases: { | ||
DB: 'db-tests' | ||
}, | ||
bindings: { | ||
TEST_MIGRATIONS: migrations | ||
}, | ||
compatibilityDate: '2024-11-20', | ||
compatibilityFlags: ['nodejs_compat'] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Example Cloudflare Workers configuration | ||
# This file is a template. Replace the placeholders with your actual configuration. | ||
|
||
name = "<your-project-name>" # Replace with your project name | ||
main = "src/index.ts" | ||
compatibility_date = "2024-11-20" | ||
compatibility_flags = [ "nodejs_compat" ] | ||
|
||
[[d1_databases]] | ||
binding = "DB" | ||
database_name = "<your-database-name>" # Replace with the name of your D1 database | ||
database_id = "<your-database-id>" # Replace with your actual D1 database ID | ||
migrations_dir = "./src/migrations" |