diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 675c540..c922a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,11 @@ name: CI on: - push: - branches: [main] + pull_request: branches: [main] + push: + branches: [main] jobs: build-and-test: @@ -17,11 +18,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "22" + node-version: "18" - name: Install dependencies run: npm install + + - name: Build TypeScript run: npm run build @@ -31,6 +34,8 @@ jobs: - name: Run ESLint run: npm run lint + + # FOR IT TO WORK WITH GITHUB Actions and push to Docker registry do the following # In your repo settings, go to Settings → Secrets and variables → Actions → Secrets, and add: # DOCKER_USERNAME – your Docker Hub username diff --git a/src/LedBlue.ts b/src/LedBlue.ts new file mode 100644 index 0000000..86dca87 --- /dev/null +++ b/src/LedBlue.ts @@ -0,0 +1,3 @@ +export function isLedBlue(red: boolean, green: boolean, blue: boolean): boolean{ + return red == false && green == false && blue == true; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4491af4..1375169 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,4 +14,4 @@ app.get("/", (req: Request, res: Response) => { // Start the server app.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); -}); +}); \ No newline at end of file diff --git a/src/test/ledBlue.test.ts b/src/test/ledBlue.test.ts new file mode 100644 index 0000000..fe0c3e3 --- /dev/null +++ b/src/test/ledBlue.test.ts @@ -0,0 +1,2 @@ +import { describe, it, expect } from "vitest"; +import { isOverheating } from "../temperature";