Skip to content
Open
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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Node.js CI

on:
push:
branches: [main, master, WHS_VULN_DETEC]
pull_request:
branches: [main, master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build (if present)
run: npm run build --if-present
- name: Lint (ignore error)
run: npm run lint || true

- name: Test each JS file (excluding node_modules)
run: |
set +e
LOG_ALL="test_results.log"
LOG_FAIL="test_failed.log"
> $LOG_ALL
> $LOG_FAIL
# node_modules 제외하고 .js 순회
for f in $(find . -type f -name '*.js' -not -path "./node_modules/*"); do
echo "===== TEST $f =====" | tee -a $LOG_ALL
OUT=$(node "$f" 2>&1)
CODE=$?
echo "$OUT" >> $LOG_ALL
if [ $CODE -ne 0 ]; then
echo "[❌ FAIL] $f" | tee -a $LOG_FAIL
echo "에러 로그:" >> $LOG_FAIL
echo "$OUT" >> $LOG_FAIL
echo "" >> $LOG_FAIL
else
echo "[✅ PASS] $f" | tee -a $LOG_ALL
fi
done
echo "테스트 완료." | tee -a $LOG_ALL
exit 0
continue-on-error: true

- name: Upload test logs
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
test_results.log
test_failed.log
20 changes: 20 additions & 0 deletions .github/workflows/pr_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Notifier

on:
pull_request:
types: [opened, reopened, closed]

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify Discord
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" -d '{"content": "🔔 Pull Request [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}) by ${{ github.event.pull_request.user.login }} - ${{ github.event.action }}"}' $DISCORD_WEBHOOK_URL
- name: Notify Slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" -d '{"text": ":bell: Pull Request <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> by ${{ github.event.pull_request.user.login }} - ${{ github.event.action }}"}' $SLACK_WEBHOOK_URL
68 changes: 45 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
{
"name": "corner4",
"name": "autogen-js-project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "npm-run-all --parallel start:**",
"start:server": "cd server && nodemon server",
"start:client": "cd client && npm start",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "for f in $(find . -type f -name '*.js'); do echo \"[TEST] $f\"; node $f || exit 1; done"
},
"repository": {
"type": "git",
"url": "git+https://github.com/koh0074/corner4.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/koh0074/corner4/issues"
},
"homepage": "https://github.com/koh0074/corner4#readme",
"dependencies": {
"axios": "^1.7.9",
"express": "^4.21.2"
},
"devDependencies": {
"http-proxy-middleware": "^3.0.3",
"nodemon": "^3.1.9",
"npm-run-all": "^4.1.5"
"@testing-library/jest-dom": "*",
"@testing-library/react": "*",
"axios": "*",
"babel-cli": "*",
"bcrypt": "*",
"body-parser": "*",
"chai": "*",
"cookie-parser": "*",
"cors": "*",
"dotenv": "*",
"ejs": "*",
"eslint": "*",
"express": "*",
"express-session": "*",
"hapi": "*",
"http-proxy-middleware": "*",
"jest": "*",
"jsonwebtoken": "*",
"koa": "*",
"lodash": "*",
"mocha": "*",
"mongodb": "*",
"mongoose": "*",
"morgan": "*",
"multer": "*",
"mysql2": "*",
"nodemon": "*",
"nunjucks": "*",
"passport": "*",
"passport-local": "*",
"pg": "*",
"prettier": "*",
"pug": "*",
"react": "*",
"react-dom": "*",
"react-router-dom": "*",
"redis": "*",
"sequelize": "*",
"sqlite3": "*",
"supertest": "*",
"ts-node": "*",
"typescript": "*"
}
}
}
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Code is Modified!!!