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
78 changes: 28 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,30 @@ on:
pull_request:
branches: [ main, develop ]

env:
CI: true
NODE_VERSION: '18'

jobs:
lint_and_test:
name: Lint & Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js

- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version: 20
cache: 'npm'

- name: Install ESLintv8
- name: Install ESLint
run: npm install --save-dev eslint@8

- name: Run ESLint
run: npx eslint src --ext .js,.jsx --max-warnings=0

- name: Run Jest tests
run: npm run test:ci

# - name: Run Lighthouse CI
# run: npx lhci autorun --config=.lighthouserc.js

- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
Expand All @@ -48,34 +41,31 @@ jobs:
name: Build & Validate
runs-on: ubuntu-latest
needs: lint_and_test
strategy:
matrix:
node-version: [18.x]


steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js

- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci
run: npm install

- name: Install serve
run: npm install -g serve

- name: Build project
run: |
npm run build
ls -la build
npm run build
ls -la build

- name: Set Public Url
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
run: echo "PUBLIC_URL=." >> $GITHUB_ENV

- name: Start Server and Log Output
run: |
npx serve -s build -l 8080 > server.log 2>&1 &
Expand All @@ -86,7 +76,7 @@ jobs:
- name: Display Server Logs
run: cat server.log

- name: verify server running
- name: Verify server running
run: |
for i in {1..3}; do
echo "Attempt $i to check server status..."
Expand All @@ -99,34 +89,22 @@ jobs:
fi
done
curl -I http://localhost:8080 || (echo "Server is not running after 3 attempts" && exit 1)

- name: Check service worker
run: |
grep -i "serviceWorker" build/index.html || echo "❌ No service worker registered"
ls build/service-worker.js || echo "❌ service-worker.js not found"

- name: List build content
run: ls -la build

- name: Log server contents
run: cat server.log

- name: Debug loaded HTML
run: curl -s http://localhost:8080 | tee page.html

- name: Debug Build Output
run: |
echo "🔍 Build manifest.json:"
cat build/manifest.json || echo "❌ manifest.json missing"

echo "🔍 Check index.html for manifest link:"
grep -i "manifest" build/index.html || echo "❌ Manifest not linked"

echo "🔍 Apple touch icon:"
grep -i "apple-touch-icon" build/index.html || echo "❌ Not linked"

echo "🔍 Check icons folder:"
ls -lh build/icons || echo "❌ Icons folder missing"
echo "🔍 manifest.json:"
cat build/manifest.json || echo "❌ missing"
echo "🔍 index.html link to manifest:"
grep -i "manifest" build/index.html || echo "❌ not linked"
echo "🔍 apple-touch-icon:"
grep -i "apple-touch-icon" build/index.html || echo "❌ not linked"
echo "🔍 icons folder:"
ls -lh build/icons || echo "❌ missing"
#
# - name: Run Lighthouse audit
# uses: treosh/lighthouse-ci-action@v9
Expand All @@ -141,7 +119,7 @@ jobs:

- name: Package Extension
run: npm run package

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Ignore coverage .gitignore

#node modules take up alot of space after npm install
#build related
node_modules
Expand All @@ -21,3 +23,7 @@ Icon
#sensitive code
.settings/
.vscode/

# Test coverage
coverage/

1 change: 1 addition & 0 deletions .lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
}
}
}


2 changes: 1 addition & 1 deletion coverage/coverage-final.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"D:\\Cheaper\\cheaperFrontEnd\\cheaperFrontEnd\\src\\App.js": {"path":"D:\\Cheaper\\cheaperFrontEnd\\cheaperFrontEnd\\src\\App.js","statementMap":{"0":{"start":{"line":6,"column":44},"end":{"line":6,"column":56}},"1":{"start":{"line":7,"column":40},"end":{"line":7,"column":55}},"2":{"start":{"line":8,"column":40},"end":{"line":8,"column":55}},"3":{"start":{"line":9,"column":56},"end":{"line":9,"column":68}},"4":{"start":{"line":11,"column":23},"end":{"line":26,"column":3}},"5":{"start":{"line":12,"column":4},"end":{"line":12,"column":25}},"6":{"start":{"line":13,"column":4},"end":{"line":13,"column":25}},"7":{"start":{"line":16,"column":4},"end":{"line":25,"column":13}},"8":{"start":{"line":17,"column":26},"end":{"line":21,"column":7}},"9":{"start":{"line":23,"column":6},"end":{"line":23,"column":36}},"10":{"start":{"line":24,"column":6},"end":{"line":24,"column":28}},"11":{"start":{"line":28,"column":2},"end":{"line":78,"column":4}},"12":{"start":{"line":45,"column":14},"end":{"line":51,"column":20}},"13":{"start":{"line":60,"column":23},"end":{"line":60,"column":94}},"14":{"start":{"line":70,"column":27},"end":{"line":70,"column":53}}},"fnMap":{"0":{"name":"App","decl":{"start":{"line":5,"column":9},"end":{"line":5,"column":12}},"loc":{"start":{"line":5,"column":15},"end":{"line":79,"column":1}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":11,"column":23},"end":{"line":11,"column":24}},"loc":{"start":{"line":11,"column":39},"end":{"line":26,"column":3}},"line":11},"2":{"name":"(anonymous_2)","decl":{"start":{"line":16,"column":15},"end":{"line":16,"column":16}},"loc":{"start":{"line":16,"column":21},"end":{"line":25,"column":5}},"line":16},"3":{"name":"(anonymous_3)","decl":{"start":{"line":44,"column":30},"end":{"line":44,"column":31}},"loc":{"start":{"line":45,"column":14},"end":{"line":51,"column":20}},"line":45},"4":{"name":"(anonymous_4)","decl":{"start":{"line":60,"column":17},"end":{"line":60,"column":18}},"loc":{"start":{"line":60,"column":23},"end":{"line":60,"column":94}},"line":60},"5":{"name":"(anonymous_5)","decl":{"start":{"line":70,"column":21},"end":{"line":70,"column":22}},"loc":{"start":{"line":70,"column":27},"end":{"line":70,"column":53}},"line":70}},"branchMap":{"0":{"loc":{"start":{"line":35,"column":7},"end":{"line":37,"column":7}},"type":"binary-expr","locations":[{"start":{"line":35,"column":7},"end":{"line":35,"column":18}},{"start":{"line":36,"column":8},"end":{"line":36,"column":71}}],"line":35},"1":{"loc":{"start":{"line":39,"column":7},"end":{"line":57,"column":7}},"type":"binary-expr","locations":[{"start":{"line":39,"column":7},"end":{"line":39,"column":19}},{"start":{"line":39,"column":23},"end":{"line":39,"column":34}},{"start":{"line":40,"column":8},"end":{"line":56,"column":14}}],"line":39},"2":{"loc":{"start":{"line":43,"column":11},"end":{"line":55,"column":11}},"type":"cond-expr","locations":[{"start":{"line":44,"column":12},"end":{"line":52,"column":14}},{"start":{"line":54,"column":12},"end":{"line":54,"column":88}}],"line":43},"3":{"loc":{"start":{"line":66,"column":7},"end":{"line":76,"column":7}},"type":"binary-expr","locations":[{"start":{"line":66,"column":7},"end":{"line":66,"column":26}},{"start":{"line":67,"column":8},"end":{"line":75,"column":14}}],"line":66}},"s":{"0":9,"1":9,"2":9,"3":9,"4":9,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":9,"12":3,"13":1,"14":0},"f":{"0":9,"1":1,"2":1,"3":3,"4":1,"5":0},"b":{"0":[9,1],"1":[9,8,1],"2":[1,0],"3":[9,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"8167e691cfaee5596c0e870f7ca50a4c7651285f"}
}
}
2 changes: 1 addition & 1 deletion coverage/lcov-report/App.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -322,4 +321,5 @@ <h1><a href="index.html">All files</a> App.js</h1>
<script src="block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ pre.prettyprint {
}
.footer, .push {
height: 48px;
}
}
2 changes: 1 addition & 1 deletion coverage/lcov-report/block-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ var jumpToCode = (function init() {
}
};
})();
window.addEventListener('keydown', jumpToCode);
window.addEventListener('keydown', jumpToCode);
2 changes: 1 addition & 1 deletion coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -113,4 +112,5 @@ <h1>All files</h1>
<script src="block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/prettify.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coverage/lcov-report/prettify.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion coverage/lcov-report/sorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ var addSorting = (function() {
};
})();

window.addEventListener('load', addSorting);
window.addEventListener('load', addSorting);
1 change: 0 additions & 1 deletion coverage/lcov-report/src/App.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/background/background.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -82,4 +81,5 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/backgrou
<script src="../../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/background/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -113,4 +112,5 @@ <h1><a href="../../index.html">All files</a> src/background</h1>
<script src="../../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/components/SearchBar.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -172,4 +171,5 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/componen
<script src="../../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/components/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -113,4 +112,5 @@ <h1><a href="../../index.html">All files</a> src/components</h1>
<script src="../../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/content/content.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -82,4 +81,5 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/content<
<script src="../../block-navigation.js"></script>
</body>
</html>


1 change: 0 additions & 1 deletion coverage/lcov-report/src/content/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -113,4 +112,5 @@ <h1><a href="../index.html">All files</a> src</h1>
<script src="../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/popup/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -113,4 +112,5 @@ <h1><a href="../../index.html">All files</a> src/popup</h1>
<script src="../../block-navigation.js"></script>
</body>
</html>


2 changes: 1 addition & 1 deletion coverage/lcov-report/src/popup/popup.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!doctype html>
<html lang="en">

Expand Down Expand Up @@ -82,4 +81,5 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/popup</a
<script src="../../block-navigation.js"></script>
</body>
</html>


Loading