Skip to content
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
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI/CD Pipeline

on:
push:
branches: [ main, dev, 7-feat-add-workflow-ci ]
pull_request:
branches: [ main, dev, 7-feat-add-workflow-ci ]

jobs:
test-and-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

# Install and test client
- name: Install client dependencies
working-directory: ./client
run: |
npm install
npm run build

- name: Run client tests
working-directory: ./client
run: |
npm test -- --passWithNoTests --no-watch

- name: Run client linting
working-directory: ./client
run: |
rm -rf build/
npm run lint -- --quiet || echo "Linting issues found, but continuing build"

# Install and test server
- name: Install server dependencies
working-directory: ./server
run: npm install

# Build server (if needed)
- name: Build server
working-directory: ./server
run: npm run build || echo "No build script found, skipping"

deploy:
needs: test-and-build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
6 changes: 6 additions & 0 deletions client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
build/
dist/
coverage/
postcss.config.js
tailwind.config.js
41 changes: 34 additions & 7 deletions client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
import js from "@eslint/js";
import globals from "globals";
import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";
import babelParser from "@babel/eslint-parser";


export default defineConfig([
{ files: ["**/*.{js,mjs,cjs,jsx}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.{js,mjs,cjs,jsx}"], languageOptions: { globals: globals.browser } },
pluginReact.configs.flat.recommended,
]);
export default [
{
files: ["**/*.{js,mjs,cjs,jsx}"],
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-react"],
},
ecmaVersion: 2021,
sourceType: "module",
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
react: pluginReact,
},
rules: {
...js.configs.recommended.rules,
...pluginReact.configs.recommended.rules,
},
settings: {
react: {
version: "detect",
},
},
},
];
10 changes: 10 additions & 0 deletions client/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: 'react-scripts',
testEnvironment: 'jsdom',
transformIgnorePatterns: [
"node_modules/(?!(axios|react-router|@remix-run)/)"
],
moduleNameMapper: {
'^axios$': '<rootDir>/node_modules/axios/dist/axios.js'
}
};
Loading