Merge pull request #8 from rafiarrafif/ci

Implement a continue integration test
This commit is contained in:
Rafi Arrafif
2026-01-31 18:42:28 +07:00
committed by GitHub
5 changed files with 60 additions and 0 deletions

View File

@ -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

View File

@ -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"
}, },

View 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();

View File

@ -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;
}; };

View File

@ -0,0 +1,6 @@
import Elysia from "elysia";
export const mediaModule = new Elysia({ prefix: "/media" }).get(
"/",
() => "Media Module",
);