Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow file for action to check types, lint, format #40

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-frontend:
name: Format, Lint, Types (Frontend)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Install deps
run: pnpm i
working-directory: ./frontend

- name: Check Format
run: pnpm format:check
working-directory: ./frontend

- name: Check Lint
run: pnpm lint
working-directory: ./frontend

- name: Check Types
run: pnpm types
working-directory: ./frontend

check-backend:
name: Format, Lint, Types (Backend)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Install deps
run: pnpm i
working-directory: ./backend

- name: Check Format
run: pnpm format:check
working-directory: ./backend

- name: Check Lint
run: pnpm lint
working-directory: ./backend

- name: Check Types
run: pnpm types
working-directory: ./backend
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: update backend deployment

on:
push:
branches:
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# wg-app WIP

## (OUTDATED): User flow

https://excalidraw.com/#room=2a90cf068f4d87bce613,24I3dxykUBivS35QOdgTqw

## setup

- Install all dependencies
Expand Down
Empty file removed backend/README.md
Empty file.
5 changes: 3 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
},
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier -w \"src/**/*.ts\"",
"format:check": "prettier -c \"src/**/*.ts\"",
"start": "nest start",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "pm2 restart dist/src/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
4 changes: 4 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
32 changes: 32 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
import unusedImports from 'eslint-plugin-unused-imports';

export default [
{
plugins: {
'unused-imports': unusedImports,
},
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
},
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReactConfig,
];
15 changes: 13 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"types": "pnpm tsc"
"types": "pnpm tsc",
"format": "prettier -w \"src/**/*.ts\"",
"format:check": "prettier -c \"src/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
},
"dependencies": {
"@expo/metro-runtime": "~3.2.1",
Expand Down Expand Up @@ -46,13 +49,21 @@
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/plugin-transform-class-static-block": "^7.24.4",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.6.0",
"@tanstack/eslint-plugin-query": "^5.28.11",
"@tsconfig/react-native": "^3.0.5",
"@types/jest": "^29.5.12",
"@types/react": "18.2.79",
"@types/react-test-renderer": "^18.3.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-unused-imports": "^4.0.0",
"globals": "^15.7.0",
"prettier": "^3.3.2",
"tailwindcss": "3.3.2",
"typescript": "5.3.3"
"typescript": "5.3.3",
"typescript-eslint": "^7.14.1"
},
"private": true,
"packageManager": "[email protected]+sha1.a58c038faac410c947dbdb93eb30994037d0fce2"
Expand Down
Loading
Loading