Skip to content
Closed
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
27 changes: 0 additions & 27 deletions .github/workflows/dependency.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/filesize-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .github/workflows/filesize-monitor.yml

name: Filesize Monitor

on:
pull_request:
branches:
- main

jobs:
check-file-sizes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Report Public Asset Sizes
run: |
echo "### Frontend Asset Sizes" >> $GITHUB_STEP_SUMMARY
echo "| File | Size |" >> $GITHUB_STEP_SUMMARY
echo "|------|------|" >> $GITHUB_STEP_SUMMARY
ls -lh public/ | awk 'NR>1 {print "| " $9 " | " $5 " |"}' >> $GITHUB_STEP_SUMMARY
25 changes: 25 additions & 0 deletions .github/workflows/performance-monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .github/workflows/performance-monitoring.yml

name: Performance Monitor

on:
schedule:
- cron: '0 0 * * 1' # Runs every Monday at midnight UTC
workflow_dispatch: # Allows manual triggering

jobs:
lighthouse-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v11
with:
# URLs from the README to audit
urls: |
https://weather-available.netlify.app
https://weather-api-ex1z.onrender.com/delhi
# Optional: Set a performance budget
budgetPath: ./lighthouse-budget.json
18 changes: 18 additions & 0 deletions .github/workflows/render-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/workflows/render-deploy.yml

name: Deploy to Render

on:
push:
branches:
- main # Trigger deployment on push to main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Render Deploy Hook
run: curl -X POST ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
# Project admin please add the deployment hook URL from Render
# as a secret named RENDER_DEPLOY_HOOK_URL in the GitHub repository
# settings for this to work.
41 changes: 41 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# .github/workflows/security.yml

name: Security Scan

on:
schedule:
- cron: "0 0 * * 0" # Run weekly on Sundays at midnight
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allow manual triggering

jobs:
npm-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run npm audit
run: npm audit --audit-level=high

codeql-scan:
runs-on: ubuntu-latest
permissions:
security-events: write # Required for CodeQL to report findings
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
File renamed without changes.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ weather-api/
- **Cheerio** – Scraping and parsing made easy 🧐
- **CORS** – Secure cross-origin requests 🔄
- **dotenv** – Manages environment variables 🔐
- **Jest** - Efficient And RObut management for testing 💪🏻

---

Expand Down
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// babel.config.js
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
],
};
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: "jsdom", // Use jsdom environment for all tests
setupFilesAfterEnv: ["./jest.setup.js"],
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
transformIgnorePatterns: [
// Ignore all node_modules except cheerio (allows jest to transpile cheerio)
'node_modules/(?!(cheerio)/)',
],
};
5 changes: 5 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// jest.setup.js
const { TextEncoder, TextDecoder } = require('util');

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
11 changes: 11 additions & 0 deletions lighthouse-budget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// lighthouse-budget.json

[
{
"path": "/*",
"performance": 80,
"accessibility": 90,
"best-practices": 90,
"seo": 90
}
]
Loading