Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Jan 10, 2025
1 parent 4c65af2 commit 26519ad
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 28 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: yarn lint

- name: Run unit tests
run: yarn test --reporter=default --reporter=junit --outputFile=test-report.junit.xml
run: yarn test

- name: Upload coverage reports to Codecov
if: success()
Expand All @@ -44,29 +44,6 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

bundle_analysis:
name: Bundle Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: |
yarn --immutable
- name: Build app for production
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn build

e2e-tests:
name: End-to-End (with mock data) Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -176,6 +153,30 @@ jobs:
with:
name: Inventory management system (with api) Screenshots
path: cypress/screenshots
bundle_analysis:
# This job triggers only if all the other jobs succeed.
needs: [lint-and-unit-test, e2e-tests, e2e-tests-api]
name: Bundle Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: |
yarn --immutable
- name: Build app for production
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn build

docker:
# This job triggers only if all the other jobs succeed. It builds the Docker image and if successful,
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/with_mock_data/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ describe('Systems', () => {
});

it('edits a system from a landing page', () => {
// Catch error to avoid the CI failing unnecessarily
Cypress.on('uncaught:exception', (err) => {
if (err.message.includes('ResizeObserver')) {
return false;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"packageManager": "[email protected]",
"devDependencies": {
"@babel/eslint-parser": "7.25.9",
"@codecov/vite-plugin": "^1.7.0",
"@codecov/vite-plugin": "1.7.0",
"@eslint/compat": "1.2.4",
"@eslint/js": "9.17.0",
"@tanstack/eslint-plugin-query": "5.62.1",
Expand All @@ -104,6 +104,7 @@
"express": "4.21.2",
"globals": "15.13.0",
"jsdom": "25.0.1",
"junit": "1.4.9",
"prettier": "3.4.2",
"serve": "14.2.4",
"serve-static": "1.16.2",
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { codecovVitePlugin } from '@codecov/vite-plugin';
import react from '@vitejs/plugin-react';
import browserslistToEsbuild from 'browserslist-to-esbuild';
import fs from 'node:fs';
Expand Down Expand Up @@ -63,6 +64,7 @@ export default defineConfig(({ mode }) => {
// Allow hot reloading of json files in public folder when in development
if (env.NODE_ENV === 'development') plugins.push(jsonHMR());

// Allow codecov bundle analysis
if (env.VITE_APP_INCLUDE_CODECOV === 'true')
plugins.push(
codecovVitePlugin({
Expand Down Expand Up @@ -159,6 +161,8 @@ export default defineConfig(({ mode }) => {
'json',
// Extra for VSCode extension
['lcov', { outputFile: 'lcov.info', silent: true }],
// Extra for codecov test analysis
['junit', { outputFile: 'test-report.junit.xml', silent: true }],
],
exclude: [
...vitestCoverageConfigDefaultsExclude,
Expand Down
70 changes: 67 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ __metadata:
languageName: node
linkType: hard

"@codecov/vite-plugin@npm:^1.7.0":
"@codecov/vite-plugin@npm:1.7.0":
version: 1.7.0
resolution: "@codecov/vite-plugin@npm:1.7.0"
dependencies:
Expand Down Expand Up @@ -2975,7 +2975,7 @@ __metadata:
languageName: node
linkType: hard

"brace-expansion@npm:^1.1.7":
"brace-expansion@npm:^1.0.0, brace-expansion@npm:^1.1.7":
version: 1.1.11
resolution: "brace-expansion@npm:1.1.11"
dependencies:
Expand Down Expand Up @@ -3367,6 +3367,15 @@ __metadata:
languageName: node
linkType: hard

"commander@npm:2.9.0":
version: 2.9.0
resolution: "commander@npm:2.9.0"
dependencies:
graceful-readlink: "npm:>= 1.0.0"
checksum: 10c0/56bcda1e47f453016ed25d9f300bed9e622842a5515802658adb62792fa2ff9af6ee3f9ff16e058d7b20aacc78fb3baa3e02f982414bae1fb5f198c7cb41d5ad
languageName: node
linkType: hard

"commander@npm:^6.2.1":
version: 6.2.1
resolution: "commander@npm:6.2.1"
Expand Down Expand Up @@ -5093,6 +5102,13 @@ __metadata:
languageName: node
linkType: hard

"graceful-readlink@npm:>= 1.0.0":
version: 1.0.1
resolution: "graceful-readlink@npm:1.0.1"
checksum: 10c0/c53e703257e77f8a4495ff0d476c09aa413251acd26684f4544771b15e0ad361d1075b8f6d27b52af6942ea58155a9bbdb8125d717c70df27117460fee295a54
languageName: node
linkType: hard

"graphemer@npm:^1.4.0":
version: 1.4.0
resolution: "graphemer@npm:1.4.0"
Expand Down Expand Up @@ -5377,7 +5393,7 @@ __metadata:
resolution: "inventory-management-system@workspace:."
dependencies:
"@babel/eslint-parser": "npm:7.25.9"
"@codecov/vite-plugin": "npm:^1.7.0"
"@codecov/vite-plugin": "npm:1.7.0"
"@date-io/date-fns": "npm:3.0.0"
"@emotion/react": "npm:^11.11.4"
"@emotion/styled": "npm:^11.11.5"
Expand Down Expand Up @@ -5433,6 +5449,7 @@ __metadata:
globals: "npm:15.13.0"
history: "npm:^5.3.0"
jsdom: "npm:25.0.1"
junit: "npm:^1.4.9"
loglevel: "npm:^1.9.1"
lz-string: "npm:^1.5.0"
material-react-table: "npm:^2.13.0"
Expand Down Expand Up @@ -6079,6 +6096,20 @@ __metadata:
languageName: node
linkType: hard

"junit@npm:^1.4.9":
version: 1.4.9
resolution: "junit@npm:1.4.9"
dependencies:
commander: "npm:2.9.0"
nofs: "npm:0.11.20"
yaku: "npm:0.17.8"
bin:
junit: bin/junit.js
junit-debug: bin/junit-debug.js
checksum: 10c0/b8c62621cf9455b48776245618473d03fce51d237ae3813cf5429698d8ccc9713490f2b24e9a90f330388f12050f3bb3bbc7fdf87a6929d5d35c81b4b1cd8187
languageName: node
linkType: hard

"keyv@npm:^4.5.4":
version: 4.5.4
resolution: "keyv@npm:4.5.4"
Expand Down Expand Up @@ -6464,6 +6495,15 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:3.0.3":
version: 3.0.3
resolution: "minimatch@npm:3.0.3"
dependencies:
brace-expansion: "npm:^1.0.0"
checksum: 10c0/827dcf6d4eb80c5d8a7bdcc5f88ef1c2c35e5d858122effb6bd83965e261417b9a559d3d33332b99ca98ddb7488d435e13046a1f8d6635245b906c59ee0f1185
languageName: node
linkType: hard

"minimatch@npm:3.1.2, minimatch@npm:^3.1.2":
version: 3.1.2
resolution: "minimatch@npm:3.1.2"
Expand Down Expand Up @@ -6702,6 +6742,16 @@ __metadata:
languageName: node
linkType: hard

"nofs@npm:0.11.20":
version: 0.11.20
resolution: "nofs@npm:0.11.20"
dependencies:
minimatch: "npm:3.0.3"
yaku: "npm:0.17.7"
checksum: 10c0/094589dc5fd55c7daf76278f9d8e6cb0b6397e5f7b96aada89176ed09f249f69443a4067d29f94177ecbc28f5058dffa8b31c37ffdb9b4f4aae8bd808995d417
languageName: node
linkType: hard

"nopt@npm:^7.0.0":
version: 7.2.1
resolution: "nopt@npm:7.2.1"
Expand Down Expand Up @@ -9269,6 +9319,20 @@ __metadata:
languageName: node
linkType: hard

"yaku@npm:0.17.7":
version: 0.17.7
resolution: "yaku@npm:0.17.7"
checksum: 10c0/60db9f49446bb8c40bba7129132c1a0f36283e2e5d2e6cc17b2fcc29977fcda6bc618adad2a0e29447f617af4f8007ed44155603d92e1afd5ac38be18a2ab7e6
languageName: node
linkType: hard

"yaku@npm:0.17.8":
version: 0.17.8
resolution: "yaku@npm:0.17.8"
checksum: 10c0/462eaa01716755ad211bb3e1d7b85e2ddf1d4d879e9fde3b66a46282e3d750666d0b4e409e61d095b6fcd2b8f7ee31db23040189f3eff5c469e4229087b10dd1
languageName: node
linkType: hard

"yallist@npm:^3.0.2":
version: 3.1.1
resolution: "yallist@npm:3.1.1"
Expand Down

0 comments on commit 26519ad

Please sign in to comment.