From 8f2e9a76d62cf0e1514e70457df1e571e3e25c32 Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Mon, 18 Sep 2023 18:13:57 +0530 Subject: [PATCH] Adds actions files for ui (#384) --- .github/workflows/ui-build.yml | 28 ++++++++++++++++++++++++++ .github/workflows/ui-lint.yml | 36 ++++++++++++++++++++++++++++++++++ generate_protos.sh | 12 ++++++++++++ ui/.eslintrc.json | 6 +----- ui/.prettierignore | 3 ++- ui/app/connectors/page.tsx | 1 - 6 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ui-build.yml create mode 100644 .github/workflows/ui-lint.yml create mode 100755 generate_protos.sh diff --git a/.github/workflows/ui-build.yml b/.github/workflows/ui-build.yml new file mode 100644 index 0000000000..b1acc0de4f --- /dev/null +++ b/.github/workflows/ui-build.yml @@ -0,0 +1,28 @@ +name: Build & Test UI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-test: + name: Build & Test UI + strategy: + matrix: + runner: [ubuntu-latest, ubicloud] + runs-on: ${{ matrix.runner }} + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Install Node.js dependencies + working-directory: ui + run: yarn install --frozen-lockfile + + - name: Build + working-directory: ui + run: yarn build \ No newline at end of file diff --git a/.github/workflows/ui-lint.yml b/.github/workflows/ui-lint.yml new file mode 100644 index 0000000000..d8f2e58538 --- /dev/null +++ b/.github/workflows/ui-lint.yml @@ -0,0 +1,36 @@ +name: Lint UI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + checks: write + contents: write + +jobs: + run-linters: + name: Run UI linters + strategy: + matrix: + runner: [ubuntu-latest, ubicloud] + runs-on: ${{ matrix.runner }} + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Install Node.js dependencies + working-directory: ui + run: yarn install --frozen-lockfile + + - name: lint + uses: wearerequired/lint-action@v2 + with: + eslint: true + prettier: true + eslint_dir: ui + prettier_dir: ui \ No newline at end of file diff --git a/generate_protos.sh b/generate_protos.sh new file mode 100755 index 0000000000..4124962c24 --- /dev/null +++ b/generate_protos.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -xeuo pipefail + +# check if buf is installed +if ! command -v buf &> /dev/null +then + echo "buf could not be found" + echo "Please install buf: https://buf.build/docs/installation" + exit +fi + +buf generate protos diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json index 8b326a0cc5..1aa3f3c57b 100644 --- a/ui/.eslintrc.json +++ b/ui/.eslintrc.json @@ -1,7 +1,3 @@ { - "extends": [ - "next", - "plugin:storybook/recommended", - "prettier" - ] + "extends": ["next", "plugin:storybook/recommended", "prettier"] } diff --git a/ui/.prettierignore b/ui/.prettierignore index 1380c2e74b..8514dd51b2 100644 --- a/ui/.prettierignore +++ b/ui/.prettierignore @@ -1,2 +1,3 @@ node_modules -.next \ No newline at end of file +.next +**/grpc_generated diff --git a/ui/app/connectors/page.tsx b/ui/app/connectors/page.tsx index b8570fc1c7..3297001d65 100644 --- a/ui/app/connectors/page.tsx +++ b/ui/app/connectors/page.tsx @@ -10,7 +10,6 @@ import { SearchField } from '@/lib/SearchField'; import { Select } from '@/lib/Select'; import { Table, TableCell, TableRow } from '@/lib/Table'; import { GetFlowServiceClient } from '@/rpc/rpc'; -import getConfig from 'next/config'; import Link from 'next/link'; import { Suspense } from 'react'; import { Header } from '../../lib/Header';