From 8af7625cc64543c92a7e21fcd0103fc9d489ba6e Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:03:44 +0200 Subject: [PATCH 1/6] initialized CI --- .github/workflows/weather-app.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/weather-app.yml diff --git a/.github/workflows/weather-app.yml b/.github/workflows/weather-app.yml new file mode 100644 index 0000000..02343c5 --- /dev/null +++ b/.github/workflows/weather-app.yml @@ -0,0 +1,28 @@ +name: Weather App CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: '24' + + - name: Install dependencies + run: npm install + + - name: Run Unit Tests + run: npm test From 5e5b8e4e6466e3272e30df790f4c6e918544a998 Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:06:40 +0200 Subject: [PATCH 2/6] deleted unit test from CI --- .github/workflows/weather-app.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/weather-app.yml b/.github/workflows/weather-app.yml index 02343c5..a1ed75c 100644 --- a/.github/workflows/weather-app.yml +++ b/.github/workflows/weather-app.yml @@ -23,6 +23,3 @@ jobs: - name: Install dependencies run: npm install - - - name: Run Unit Tests - run: npm test From 09388d94d02be393739705a7ebfccf6891044de5 Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:12:20 +0200 Subject: [PATCH 3/6] add working-directory CL --- .github/workflows/weather-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/weather-app.yml b/.github/workflows/weather-app.yml index a1ed75c..8df481b 100644 --- a/.github/workflows/weather-app.yml +++ b/.github/workflows/weather-app.yml @@ -23,3 +23,4 @@ jobs: - name: Install dependencies run: npm install + working-directory: ./task-1 From ec7a4399d7ca884e0f6f2ce992e850d134de3734 Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:30:05 +0200 Subject: [PATCH 4/6] Build CL --- task-1/package-lock.json | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/task-1/package-lock.json b/task-1/package-lock.json index a0131d8..7fa0c7b 100644 --- a/task-1/package-lock.json +++ b/task-1/package-lock.json @@ -927,9 +927,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -947,9 +944,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -967,9 +961,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -987,9 +978,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1007,9 +995,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1027,9 +1012,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3004,9 +2986,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3028,9 +3007,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3052,9 +3028,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3076,9 +3049,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ From a034f67bc223b1d4c4fb83c097fa6b9f18b9b2c6 Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:34:37 +0200 Subject: [PATCH 5/6] fixed linter error --- task-1/src/components/SearchBar.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/task-1/src/components/SearchBar.tsx b/task-1/src/components/SearchBar.tsx index 6574666..ff28b26 100644 --- a/task-1/src/components/SearchBar.tsx +++ b/task-1/src/components/SearchBar.tsx @@ -1,4 +1,4 @@ -import { useState, type FormEvent, type KeyboardEvent } from "react"; +import { useState, type FormEvent, type KeyboardEvent } from 'react'; interface Props { onSearch: (city: string) => void; @@ -6,8 +6,7 @@ interface Props { } export function SearchBar({ onSearch, loading }: Props) { - const [value, setValue] = useState(""); - const unusedConstMaybeDeleteMe = "Search"; + const [value, setValue] = useState(''); const handleSubmit = (e: FormEvent) => { e.preventDefault(); @@ -15,7 +14,7 @@ export function SearchBar({ onSearch, loading }: Props) { }; const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === "Enter" && value.trim()) onSearch(value); + if (e.key === 'Enter' && value.trim()) onSearch(value); }; return ( @@ -37,7 +36,7 @@ export function SearchBar({ onSearch, loading }: Props) { disabled={loading || !value.trim()} aria-label="Search weather" > - {loading ? "Searching…" : "Search"} + {loading ? 'Searching…' : 'Search'} ); From b6339a94e70347064335bdd5eaea50f5ff44494d Mon Sep 17 00:00:00 2001 From: Salem Ba-rabuod Date: Wed, 8 Apr 2026 22:37:23 +0200 Subject: [PATCH 6/6] upload yml file --- .github/workflows/weather-app.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/weather-app.yml b/.github/workflows/weather-app.yml index 8df481b..b9a856c 100644 --- a/.github/workflows/weather-app.yml +++ b/.github/workflows/weather-app.yml @@ -24,3 +24,24 @@ jobs: - name: Install dependencies run: npm install working-directory: ./task-1 + + - name: Run Linter to check for code errors + run: npm run lint + working-directory: ./task-1 + + - name: Run Unit Tests + run: npm test + working-directory: ./task-1 + + - name: Build the React application. + run: npm run build + working-directory: ./task-1 + + - name: Zip the build output folder + run: zip -r build.zip dist + working-directory: ./task-1 + + - name: Upload it as a build artefact. + uses: actions/upload-artifact@v5 + with: + path: task-1/build.zip