Skip to content

Commit

Permalink
finos#1096 add lint and typecheck to test-ui CI/CD workflow
Browse files Browse the repository at this point in the history
- Our current CI/CD workflow is unable to catch any linting or
  typecheck errors. Adding these checks will help catch them
  before they are committed into main.
- This change also defines a new action `setup-vuu-ui` which
  abstracts away common steps for ui jobs leading to better
  modularity and reusability.
  • Loading branch information
junaidzm13 committed Jan 3, 2024
1 parent a9ca505 commit b34bce1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 42 deletions.
19 changes: 19 additions & 0 deletions .github/actions/setup-vuu-ui/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Setup Vuu UI"
description: "Installs NodeJS and project dependencies"

runs:
using: 'composite'
steps:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
shell: bash
run: cd ./vuu-ui && npm install
13 changes: 2 additions & 11 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- run: cd ./vuu-ui && npm install
- name: Install Node & dependencies
uses: ./.github/actions/setup-vuu-ui
- run: cd ./vuu-ui && npm run build
48 changes: 17 additions & 31 deletions .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: "Test"
name: "Test UI"
on:
workflow_dispatch:
pull_request:

jobs:
lint-and-typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node & dependencies
uses: ./.github/actions/setup-vuu-ui
- run: cd ./vuu-ui && npm run lint
- run: cd ./vuu-ui && npm run typecheck

vitest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: cd ./vuu-ui && npm install
- name: Install Node & dependencies
uses: ./.github/actions/setup-vuu-ui
- run: cd ./vuu-ui && npm run test:vite

cypress-e2e:
Expand All @@ -31,18 +31,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: cd ./vuu-ui && npm install
- name: Install Node & dependencies
uses: ./.github/actions/setup-vuu-ui
- name: Run end-to-end tests in Chrome
uses: cypress-io/github-action@bd9dda317ed2d4fbffc808ba6cdcd27823b2a13b
with:
Expand All @@ -68,12 +58,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install dependencies
run: cd ./vuu-ui && npm install
- name: Install Node & dependencies
uses: ./.github/actions/setup-vuu-ui
- name: Build Vuu Libraries
run: cd ./vuu-ui && npm run build
- name: Build Vuu app
Expand Down

0 comments on commit b34bce1

Please sign in to comment.