From 41072ce4663ed5644f2bf3d7b1a58c141f4c0c16 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 16:58:10 +0300 Subject: [PATCH 01/14] ci: Create node.js.yml --- .github/workflows/node.js.yml | 92 +++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..04369f1 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,92 @@ +name: Full Stack CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test-api-linux: + name: API Test (Linux) + runs-on: ubuntu-latest + defaults: + run: + working-directory: api + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + + test-frontend-linux: + name: Frontend Test (Linux) + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + + test-api-windows: + name: API Test (Windows) + runs-on: windows-latest + defaults: + run: + working-directory: api + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + + test-frontend-windows: + name: Frontend Test (Windows) + runs-on: windows-latest + defaults: + run: + working-directory: frontend + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test From 7425a48074c45c67b70ab0a41294ce2ce65f1f18 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 17:00:51 +0300 Subject: [PATCH 02/14] ci: Update `node.js.yml` to make any ci branch to activate jobs --- .github/workflows/node.js.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 04369f1..af9f1f1 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -2,9 +2,13 @@ name: Full Stack CI on: push: - branches: [ "main" ] + branches: + - main + - 'ci*' pull_request: - branches: [ "main" ] + branches: + - main + - 'ci*' jobs: test-api-linux: From a3bd0cec2c930ed84c0353678ee9cf9c41c8d99d Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 17:05:48 +0300 Subject: [PATCH 03/14] ci: Fix cache-dependancy-path in yml --- .github/workflows/node.js.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index af9f1f1..530add2 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 @@ -29,6 +29,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + cache-dependency-path: api/package-lock.json - run: npm ci - run: npm test @@ -41,7 +42,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 @@ -50,6 +51,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + cache-dependency-path: frontend/package-lock.json - run: npm ci - run: npm test @@ -62,7 +64,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 @@ -71,6 +73,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + cache-dependency-path: api/package-lock.json - run: npm ci - run: npm test @@ -83,7 +86,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 @@ -92,5 +95,6 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + cache-dependency-path: frontend/package-lock.json - run: npm ci - run: npm test From c3b921abc2a1ed1d5b387e118874f9a52c358c78 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 17:38:11 +0300 Subject: [PATCH 04/14] fix(api): Update package.json to add placeholder test --- api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/package.json b/api/package.json index 3bab434..b5f72f9 100644 --- a/api/package.json +++ b/api/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "echo \"No tests yet\"", "backend": "nodemon server.js " }, "nodemonConfig": { From dfd85ef99bcc8286c7a7a5175037c222766df30f Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:08:56 +0300 Subject: [PATCH 05/14] ci: test --- .github/workflows/node.js.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 530add2..26bfc3a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -52,6 +52,8 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: frontend/package-lock.json + + - run: ls -l frontend/package-lock.json - run: npm ci - run: npm test From d18ca23437610e9a9bdc42d476318f4ec2c90048 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:10:34 +0300 Subject: [PATCH 06/14] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 26bfc3a..08a0ed8 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -46,6 +46,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: ls -l frontend/package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: @@ -53,7 +54,6 @@ jobs: cache: 'npm' cache-dependency-path: frontend/package-lock.json - - run: ls -l frontend/package-lock.json - run: npm ci - run: npm test From d47c4a36860e52984c891d508f7259fbffed99e9 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:12:25 +0300 Subject: [PATCH 07/14] Update node.js.yml --- .github/workflows/node.js.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 08a0ed8..9b75403 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -24,12 +24,14 @@ jobs: steps: - uses: actions/checkout@v4 + - run: ls -l api/package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: api/package-lock.json + cache-dependency-path: | + api/package-lock.json - run: npm ci - run: npm test @@ -52,8 +54,8 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: frontend/package-lock.json - + cache-dependency-path: | + frontend/package-lock.json - run: npm ci - run: npm test @@ -70,12 +72,14 @@ jobs: steps: - uses: actions/checkout@v4 + - run: dir api\package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: api/package-lock.json + cache-dependency-path: | + api/package-lock.json - run: npm ci - run: npm test @@ -92,11 +96,13 @@ jobs: steps: - uses: actions/checkout@v4 + - run: dir frontend\package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: frontend/package-lock.json + cache-dependency-path: | + frontend/package-lock.json - run: npm ci - run: npm test From 8bbac89754d6ccfdc04e58fe0efe9eedd55e38ac Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:13:32 +0300 Subject: [PATCH 08/14] Update node.js.yml --- .github/workflows/node.js.yml | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9b75403..7f3b6e5 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -14,9 +14,6 @@ jobs: test-api-linux: name: API Test (Linux) runs-on: ubuntu-latest - defaults: - run: - working-directory: api strategy: matrix: @@ -30,17 +27,15 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: | - api/package-lock.json + cache-dependency-path: api/package-lock.json - run: npm ci + working-directory: api - run: npm test + working-directory: api test-frontend-linux: name: Frontend Test (Linux) runs-on: ubuntu-latest - defaults: - run: - working-directory: frontend strategy: matrix: @@ -54,17 +49,15 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: | - frontend/package-lock.json + cache-dependency-path: frontend/package-lock.json - run: npm ci + working-directory: frontend - run: npm test + working-directory: frontend test-api-windows: name: API Test (Windows) runs-on: windows-latest - defaults: - run: - working-directory: api strategy: matrix: @@ -78,17 +71,15 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: | - api/package-lock.json + cache-dependency-path: api/package-lock.json - run: npm ci + working-directory: api - run: npm test + working-directory: api test-frontend-windows: name: Frontend Test (Windows) runs-on: windows-latest - defaults: - run: - working-directory: frontend strategy: matrix: @@ -102,7 +93,8 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: | - frontend/package-lock.json + cache-dependency-path: frontend/package-lock.json - run: npm ci + working-directory: frontend - run: npm test + working-directory: frontend From 95583ccaaf4d9e98f81c57cff92d4120e480520f Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:15:49 +0300 Subject: [PATCH 09/14] Update node.js.yml --- .github/workflows/node.js.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7f3b6e5..3db704a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -49,11 +49,11 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: frontend/package-lock.json + cache-dependency-path: front-end/package-lock.json - run: npm ci - working-directory: frontend + working-directory: front-end - run: npm test - working-directory: frontend + working-directory: front-end test-api-windows: name: API Test (Windows) @@ -87,14 +87,14 @@ jobs: steps: - uses: actions/checkout@v4 - - run: dir frontend\package-lock.json + - run: dir front-end\package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: frontend/package-lock.json + cache-dependency-path: front-end/package-lock.json - run: npm ci - working-directory: frontend + working-directory: front-end - run: npm test - working-directory: frontend + working-directory: front-end From d912b105864271a802ee9341ea7f21c7f68116fd Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:19:36 +0300 Subject: [PATCH 10/14] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3db704a..ab8ff45 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -43,7 +43,7 @@ jobs: steps: - uses: actions/checkout@v4 - - run: ls -l frontend/package-lock.json + - run: ls -l front-end/package-lock.json - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: From 3989b4c6094942dda5d522176032966079217500 Mon Sep 17 00:00:00 2001 From: TheUCP <153499312+DEVUCP@users.noreply.github.com> Date: Sun, 22 Jun 2025 02:51:40 +0300 Subject: [PATCH 11/14] Update App.js --- front-end/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/App.js b/front-end/src/App.js index 84ad135..e3030e0 100644 --- a/front-end/src/App.js +++ b/front-end/src/App.js @@ -10,7 +10,7 @@ function App() { return ( -