Skip to content

Commit 93d2b6e

Browse files
authored
Merge pull request #9 from CS3219-AY2526Sem1/setup-github-workflows
Setup GitHub workflows
2 parents a239814 + 959aff8 commit 93d2b6e

File tree

7 files changed

+2097
-54
lines changed

7 files changed

+2097
-54
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Commit workflow
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, macos-latest, windows-latest]
10+
node-version: [20.x]
11+
runs-on: ${{ matrix.os }}
12+
defaults:
13+
run:
14+
working-directory: ./frontend/peerprep
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
21+
- run: npm run lint
22+
- run: npm run build

frontend/peerprep/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:20-alpine AS development-dependencies-env
2-
COPY . /app
32
WORKDIR /app
3+
COPY package*.json ./
44
RUN npm ci
55

66
FROM node:20-alpine AS production-dependencies-env
@@ -20,4 +20,4 @@ COPY --from=production-dependencies-env /app/node_modules /app/node_modules
2020
COPY --from=build-env /app/build /app/build
2121
WORKDIR /app
2222
EXPOSE 3000
23-
CMD ["npm", "run", "start"]
23+
CMD ["npm", "start"]

frontend/peerprep/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Make sure to deploy the output of `npm run build`
7878
│ └── server/ # Server-side code
7979
```
8080

81+
### Lint check
82+
To run the lint check:
83+
84+
```bash
85+
npm run lint
86+
```
87+
8188
## Styling
8289

8390
This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer.

frontend/peerprep/app/routes/home.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { Route } from "./+types/home";
21
import { Welcome } from "../welcome/welcome";
32

4-
export function meta({}: Route.MetaArgs) {
3+
export function meta() {
54
return [
65
{ title: "New React Router App" },
76
{ name: "description", content: "Welcome to React Router!" },

frontend/peerprep/eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Setup guide from : https://eslint-react.xyz/docs/getting-started/typescript
2+
3+
// @ts-check
4+
import eslintJs from "@eslint/js";
5+
import eslintReact from "@eslint-react/eslint-plugin";
6+
import tseslint from "typescript-eslint";
7+
export default tseslint.config({
8+
files: ["**/*.ts", "**/*.tsx"],
9+
// Extend recommended rule sets from:
10+
// 1. ESLint JS's recommended rules
11+
// 2. TypeScript ESLint recommended rules
12+
// 3. ESLint React's recommended-typescript rules
13+
extends: [
14+
eslintJs.configs.recommended,
15+
tseslint.configs.recommended,
16+
eslintReact.configs["recommended-typescript"],
17+
],
18+
// Configure language/parsing options
19+
languageOptions: {
20+
// Use TypeScript ESLint parser for TypeScript files
21+
parser: tseslint.parser,
22+
parserOptions: {
23+
// Enable project service for better TypeScript integration
24+
projectService: true,
25+
tsconfigRootDir: import.meta.dirname,
26+
},
27+
},
28+
// Custom rule overrides (modify rule levels or disable rules)
29+
rules: {
30+
"@eslint-react/no-missing-key": "warn",
31+
},
32+
});

0 commit comments

Comments
 (0)