ci/add-automatic-sync #2
35
.github/workflows/ci.yaml
vendored
35
.github/workflows/ci.yaml
vendored
@ -0,0 +1,35 @@
|
|||||||
|
name: Intergration Tests
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
integration-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup runtime environment (Bun)
|
||||||
|
uses: oven-sh/setup-bun@v1
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Install depedencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Index route sync
|
||||||
|
run: bun run route:sync
|
||||||
|
|
||||||
|
- name: Linting test
|
||||||
|
run: bun run lint
|
||||||
|
|
||||||
|
- name: Create dummy system account
|
||||||
|
run: bun run dummy:systemaccount
|
||||||
|
|
||||||
|
- name: Generate prisma schema
|
||||||
|
run: bunx prisma generate
|
||||||
|
|
||||||
|
- name: Build test
|
||||||
|
run: bun run build
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
"prisma:dbml": "bunx prisma db pull && bunx prisma dbml --output ./prisma/dbml/schema.dbml",
|
"prisma:dbml": "bunx prisma db pull && bunx prisma dbml --output ./prisma/dbml/schema.dbml",
|
||||||
"prisma:reset": "bunx prisma db push --force-reset",
|
"prisma:reset": "bunx prisma db push --force-reset",
|
||||||
"prisma:seed": "bun run ./prisma/seed/index.ts",
|
"prisma:seed": "bun run ./prisma/seed/index.ts",
|
||||||
|
"dummy:systemaccount": "bun run ./scripts/create-dummy-system-account.ts",
|
||||||
"route:sync": "bun run ./scripts/sync-routes.ts",
|
"route:sync": "bun run ./scripts/sync-routes.ts",
|
||||||
"env:publish": "bun run ./scripts/create-example-env.ts"
|
"env:publish": "bun run ./scripts/create-example-env.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
16
scripts/create-dummy-system-account.ts
Normal file
16
scripts/create-dummy-system-account.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { generateUUIDv7 } from "../src/helpers/databases/uuidv7";
|
||||||
|
import { createFile } from "../src/helpers/files/createFile";
|
||||||
|
|
||||||
|
const createDummySystemAccount = async () => {
|
||||||
|
const file = await createFile(
|
||||||
|
`export const SystemAccountId = "${generateUUIDv7()}";`,
|
||||||
|
{
|
||||||
|
fileName: "system.ts",
|
||||||
|
targetDir: "src/config/account",
|
||||||
|
overwriteIfExists: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
console.log(`Dummy system account created with id in file: ${file}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
createDummySystemAccount();
|
||||||
@ -25,4 +25,6 @@ export const createFile = async (content: string, config: CreateFileConfig) => {
|
|||||||
|
|
||||||
// Write content to the file
|
// Write content to the file
|
||||||
await fs.promises.writeFile(targetFile, content, "utf8");
|
await fs.promises.writeFile(targetFile, content, "utf8");
|
||||||
|
|
||||||
|
return targetFile;
|
||||||
};
|
};
|
||||||
|
|||||||
6
src/modules/media/index.ts
Normal file
6
src/modules/media/index.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import Elysia from "elysia";
|
||||||
|
|
||||||
|
export const mediaModule = new Elysia({ prefix: "/media" }).get(
|
||||||
|
"/",
|
||||||
|
() => "Media Module",
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user