Skip to content

Commit

Permalink
Merge pull request #20 from Northeastern-Electric-Racing/#19-Github-W…
Browse files Browse the repository at this point in the history
…orkflows

#19 Github Workflows
  • Loading branch information
Peyton-McKee authored Sep 13, 2023
2 parents ece6b78 + 3f2de6e commit b550b97
Show file tree
Hide file tree
Showing 19 changed files with 6,891 additions and 105 deletions.
66 changes: 66 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module.exports = {
extends: [
'react-app',
"react-app/jest"
], // Extending the "react-app" configuration

// Add your custom rules here
rules: {
'guard-for-in': 'error',
'prefer-arrow-callback': 'error',
'no-unsafe-negation': [
'error',
{
enforceForOrderingRelations: true,
},
],
'no-unsafe-optional-chaining': [
'error',
{
disallowArithmeticOperators: true,
},
],
eqeqeq: 'error',
'no-else-return': 'error',
'no-lonely-if': 'error',
'no-throw-literal': 'error',
'prefer-promise-reject-errors': 'error',
'no-unneeded-ternary': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-const': 'error',
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: true,
object: true,
},
AssignmentExpression: {
array: true,
object: true,
},
},
{
enforceForRenamedProperties: false,
},
],
'prefer-exponentiation-operator': 'error',
'prefer-object-spread': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
},

// Ignore patterns for ESLint
ignorePatterns: [
'**/.github/**',
'build',
'coverage',
'docs',
'lambda',
'node_modules',
'public',
'lib',
'dist',
],
};
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug-form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,6 @@ description: For any issue related to a bug
title: '[Area] - Short Description'
labels: [bug]
body:
- type: dropdown
id: browser
attributes:
label: Browser(s)
description: Which browsers does this affect?
multiple: true
options:
- Chrome
- Firefox
- Safari
- Other (specify below)
- type: dropdown
id: platform
attributes:
label: Platform(s)
description: Which platforms does this affect?
multiple: true
options:
- Desktop
- iOS
- Android
- Other (specify below)
- type: dropdown
id: version
attributes:
label: Version(s)
description: Which versions of the application does this affect?
multiple: true
options:
- production (main)
- develop
- other (specify below)
- type: textarea
id: observed-behavior
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Please request reviewers and ping on slack only after you've gone through this w
- [ ] Screenshots of UI changes (see Screenshots section)
- [ ] Remove any non-applicable sections of this template
- [ ] Assign the PR to yourself
- [ ] No `yarn.lock` changes (unless dependencies have changed)
- [ ] No `package-lock.json` changes (unless dependencies have changed)
- [ ] Request reviewers & ping on Slack
- [ ] PR is linked to the ticket (fill in the closes line below)

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'feature/**'
jobs:
run-build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Compose
run: |
sudo apt-get -y update
sudo apt-get -y install docker-compose
- name: Build Docker Compose
run: |
if ! docker-compose build; then
echo "Docker Compose build failed."
exit 1 # This will cause the workflow to fail
fi
25 changes: 25 additions & 0 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linting Check
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'feature/**'
jobs:
run-linting-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.1
cache: 'npm'
- name: Install modules
run: npm install && npm run prisma:generate
- name: Run linting check
run: npm run lint --max-warnings=0
25 changes: 25 additions & 0 deletions .github/workflows/prettier-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Prettier Check
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'feature/**'
jobs:
run-prettier-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.17.1
cache: 'npm'
- name: Install modules
run: npm install
- name: Run prettier check
run: npm run prettier-check
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.github
.vscode

client/build
client/public/index.html
client/tsconfig.json

docker-compose.yml
.eslintrc.js
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "none",
"tabWidth": 2,
"singleQuote": true,
"printWidth": 125
}
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
1 change: 0 additions & 1 deletion client/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';

Expand Down
8 changes: 1 addition & 7 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';

Expand All @@ -10,12 +9,7 @@ function App() {
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
Learn React
</a>
</header>
Expand Down
8 changes: 3 additions & 5 deletions client/src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
13 changes: 7 additions & 6 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);

root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
/**
* If you want to start measuring performance in your app,
* pass a functionto log results (for example: reportWebVitals(console.log))
* or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
*/
reportWebVitals();
Loading

0 comments on commit b550b97

Please sign in to comment.