diff --git a/.github/workflows/task-1.yaml b/.github/workflows/task-1.yaml new file mode 100644 index 0000000..b07bc30 --- /dev/null +++ b/.github/workflows/task-1.yaml @@ -0,0 +1,48 @@ +name: Integration + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./task-1 + steps: + - name: Check out code + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: "24" # Can also use 'latest' + + - name: Install dependencies + run: npm install # npm clean install + + - name: Run Linter + run: npm run lint + + - name: Run Unit Tests + run: npm test # Run vitest tests (defined in package.json + + - name: Build the React application + run: npm run build + + - name: Compress build + uses: montudor/action-zip@v1 + with: + args: zip -qq -r dist.zip task-1/dist + + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: | + dist.zip diff --git a/task-1/src/components/SearchBar.tsx b/task-1/src/components/SearchBar.tsx index 6574666..c633460 100644 --- a/task-1/src/components/SearchBar.tsx +++ b/task-1/src/components/SearchBar.tsx @@ -7,8 +7,7 @@ interface Props { export function SearchBar({ onSearch, loading }: Props) { const [value, setValue] = useState(""); - const unusedConstMaybeDeleteMe = "Search"; - + const handleSubmit = (e: FormEvent) => { e.preventDefault(); if (value.trim()) onSearch(value);