From e6793d4f4b0aab7e488a12c7a8eb4276ebc96ece Mon Sep 17 00:00:00 2001 From: Josh Holman Date: Sun, 25 Jan 2026 15:59:08 -0800 Subject: [PATCH 1/3] add simple CI --- .github/workflows/bot-ci.yml | 57 ++++++++++++++++++++++++++++++++ .github/workflows/service-ci.yml | 53 +++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .github/workflows/bot-ci.yml create mode 100644 .github/workflows/service-ci.yml diff --git a/.github/workflows/bot-ci.yml b/.github/workflows/bot-ci.yml new file mode 100644 index 0000000..aedc33e --- /dev/null +++ b/.github/workflows/bot-ci.yml @@ -0,0 +1,57 @@ +name: Bot CI + +on: + push: + branches: + - main + - 'feat/*' + paths: + - 'packages/bot/**' + - 'package.json' + - 'bun.lock' + - 'tsconfig.json' + - '.github/workflows/bot-ci.yml' + pull_request: + branches: + - main + paths: + - 'packages/bot/**' + - 'package.json' + - 'bun.lock' + - 'tsconfig.json' + - '.github/workflows/bot-ci.yml' + +jobs: + validate: + name: Validate Bot Package + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + bun- + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Run Biome check + run: cd packages/bot && bun run check + + - name: TypeScript type check + run: cd packages/bot && bun x tsc --noEmit + + # Uncomment when tests are added + # - name: Run tests + # run: cd packages/bot && bun test diff --git a/.github/workflows/service-ci.yml b/.github/workflows/service-ci.yml new file mode 100644 index 0000000..361253b --- /dev/null +++ b/.github/workflows/service-ci.yml @@ -0,0 +1,53 @@ +name: Service CI + +on: + push: + branches: + - main + - 'feat/*' + paths: + - 'packages/service/**' + - 'package.json' + - 'bun.lock' + - 'tsconfig.json' + - '.github/workflows/service-ci.yml' + pull_request: + branches: + - main + paths: + - 'packages/service/**' + - 'package.json' + - 'bun.lock' + - 'tsconfig.json' + - '.github/workflows/service-ci.yml' + +jobs: + validate: + name: Validate Service Package + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + bun- + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Run Biome check + run: cd packages/service && bun run check + + - name: TypeScript type check + run: cd packages/service && bun x tsc --noEmit From ccd070cf353b5f8d67c1e5c62cf59d2ab3beac65 Mon Sep 17 00:00:00 2001 From: Josh Holman Date: Sun, 25 Jan 2026 16:33:12 -0800 Subject: [PATCH 2/3] ci fixes --- packages/bot/src/index.ts | 6 +++--- packages/bot/src/register.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bot/src/index.ts b/packages/bot/src/index.ts index 731ec4a..2ec9dbf 100644 --- a/packages/bot/src/index.ts +++ b/packages/bot/src/index.ts @@ -1,11 +1,11 @@ -import { Hono } from "hono"; import { InteractionResponseType, InteractionType, verifyKey, } from "discord-interactions"; -import { ADD_COMMAND, DELETE_COMMAND, UPDATE_COMMAND } from "./commands"; +import { Hono } from "hono"; import { addLink, deleteLink, updateLink } from "./client"; +import { ADD_COMMAND, DELETE_COMMAND, UPDATE_COMMAND } from "./commands"; // interface Env { // DISCORD_APPLICATION_ID: string; @@ -90,7 +90,7 @@ app.post("/", async (c) => { return sendChannelMessage( `Shortlink created: https://s.acmcsuf.com/${slug} -> ${url}`, ); - } catch (error: any) { + } catch (error) { return sendChannelMessage( `Failed to create shortlink: ${error instanceof Error ? error.message : "Unknown error"}`, ); diff --git a/packages/bot/src/register.ts b/packages/bot/src/register.ts index 13b8821..76bb9a4 100644 --- a/packages/bot/src/register.ts +++ b/packages/bot/src/register.ts @@ -1,5 +1,5 @@ -import { ADD_COMMAND, DELETE_COMMAND } from "./commands"; import dotenv from "dotenv"; +import { ADD_COMMAND, DELETE_COMMAND } from "./commands"; /** * This file is meant to be run from the command line, and is not used by the From 4054f0e27e8bbf8c3ef04ba6de9c99ed407804a6 Mon Sep 17 00:00:00 2001 From: Josh Holman Date: Sun, 25 Jan 2026 16:35:23 -0800 Subject: [PATCH 3/3] rm ci on push --- .github/workflows/bot-ci.yml | 10 ---------- .github/workflows/service-ci.yml | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/.github/workflows/bot-ci.yml b/.github/workflows/bot-ci.yml index aedc33e..fafc087 100644 --- a/.github/workflows/bot-ci.yml +++ b/.github/workflows/bot-ci.yml @@ -1,16 +1,6 @@ name: Bot CI on: - push: - branches: - - main - - 'feat/*' - paths: - - 'packages/bot/**' - - 'package.json' - - 'bun.lock' - - 'tsconfig.json' - - '.github/workflows/bot-ci.yml' pull_request: branches: - main diff --git a/.github/workflows/service-ci.yml b/.github/workflows/service-ci.yml index 361253b..5bbdf84 100644 --- a/.github/workflows/service-ci.yml +++ b/.github/workflows/service-ci.yml @@ -1,16 +1,6 @@ name: Service CI on: - push: - branches: - - main - - 'feat/*' - paths: - - 'packages/service/**' - - 'package.json' - - 'bun.lock' - - 'tsconfig.json' - - '.github/workflows/service-ci.yml' pull_request: branches: - main