Skip to content

Commit

Permalink
Add new Github Action for the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Mar 10, 2024
1 parent 8d86c8b commit b374219
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/check_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check JS Code

on:
push:
branches: [ main ]
paths:
- 'ui/**'
pull_request:
branches: [ main ]
paths:
- 'ui/**'
workflow_dispatch: {}

jobs:
build:
name: Check JS Code
timeout-minutes: 30

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Set Up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Dependencies
working-directory: ui
run: npm install

- name: Check Formatting (prettier)
working-directory: ui
run: npx prettier --check .
if: success() || failure()

- name: Lint (eslint)
run: npx eslint .
if: success() || failure()

- name: Run Build (vite)
run: npm run build
if: success() || failure()
1 change: 1 addition & 0 deletions ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/**
37 changes: 37 additions & 0 deletions ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
},
"settings": {
"react": {
"version": "detect"
}
}
}
2 changes: 1 addition & 1 deletion ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"prettier": "3.2.5",
Expand Down

0 comments on commit b374219

Please sign in to comment.