chore: eslint&format check on workflow (#253)
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@@ -5,16 +5,13 @@ on:
|
|||||||
branches: [ "main", "develop" ]
|
branches: [ "main", "develop" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main", "develop" ]
|
branches: [ "main", "develop" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unittcms-test:
|
unittcms-test:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [20.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -26,9 +23,11 @@ jobs:
|
|||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Format code
|
- name: Format check
|
||||||
run: npm run format
|
run: npm run format:check
|
||||||
- name: Run unit tests
|
- name: ESLint check
|
||||||
|
run: npm run lint
|
||||||
|
- name: Unit tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
# frontend
|
# frontend
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { redirect } from 'next/navigation'
|
import { redirect } from 'next/navigation';
|
||||||
import { PageType } from '@/types/base';
|
import { PageType } from '@/types/base';
|
||||||
import Config from '@/config/config';
|
import Config from '@/config/config';
|
||||||
import LandingPage from '@/src/app/[locale]/LandingPage';
|
import LandingPage from '@/src/app/[locale]/LandingPage';
|
||||||
|
|
||||||
export default function Home({ params }: PageType) {
|
export default function Home({ params }: PageType) {
|
||||||
|
|
||||||
if (!Config.isDemoSite) {
|
if (!Config.isDemoSite) {
|
||||||
redirect(`/${params.locale}/projects`)
|
redirect(`/${params.locale}/projects`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <LandingPage params={params} />
|
return <LandingPage params={params} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"format:check": "prettier --check frontend/**/*.{js,ts,jsx,tsx,json} backend/**/*.{js,ts,json}",
|
||||||
"format": "prettier --write frontend/**/*.{js,ts,jsx,tsx,json} backend/**/*.{js,ts,json}",
|
"format": "prettier --write frontend/**/*.{js,ts,jsx,tsx,json} backend/**/*.{js,ts,json}",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"coverage": "vitest run --coverage",
|
"coverage": "vitest run --coverage",
|
||||||
|
|||||||
Reference in New Issue
Block a user