diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e05ef1a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,11 @@ +name: CI + +on: + push: + branches: ['**'] + pull_request: + branches: [main] + +jobs: + test: + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cbd67a5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: Test + +on: + workflow_call: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: TypeScript typecheck + run: npm run typecheck + + - name: Run build + run: npm run build + + - name: Run tests + run: npm run test:coverage diff --git a/README.md b/README.md index 139ba33..077eb97 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Class Sync Discord bot for syncing course deadlines across class channels and forums. Features automatic reminders, role-based cohort organization, and per-guild data isolation. +[![CI](https://github.com/masonlet/class-sync/actions/workflows/ci.yml/badge.svg)](https://github.com/masonlet/class-sync/actions/workflows/ci.yml) [![Privacy Policy](https://img.shields.io/badge/Privacy-Policy-blue)](https://github.com/masonlet/class-sync-legal/blob/main/privacy.md) [![Terms of Service](https://img.shields.io/badge/Terms-of%20Service-blue)](https://github.com/masonlet/class-sync-legal/blob/main/tos.md) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) diff --git a/package.json b/package.json index ee1c3e7..9d879d6 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "dist/src/index.js", "type": "module", "scripts": { + "typecheck": "tsc", "build": "tsc -p tsconfig.build.json", "deploy": "npm run build && node dist/deploy-commands.js", "start": "npm run build && node dist/src/index.js",