From ccb6aaf30d77226423b0981dc09577c4ac6c9c6d Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Thu, 20 Mar 2025 16:22:43 -0400 Subject: [PATCH 01/16] Added CI workflow --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b67f4a1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: [pull_request] + +jobs: + frontend: + name: Build Angular Frontend + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' # Adjust as needed + cache: 'npm' + + - name: Install dependencies + run: | + cd frontend + npm ci # Ensures a clean install with package-lock.json + + - name: Build Angular app + run: | + cd frontend + npm run build + + backend: + name: Deploy Firebase Functions + runs-on: ubuntu-latest + needs: frontend # Ensures frontend builds before deploying backend + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install Firebase CLI + run: npm install -g firebase-tools + + - name: Install backend dependencies + run: | + pip install -r backend/requirements.txt + + - name: Verify Firebase functions compile + run: | + ./backend/run.sh \ No newline at end of file From 1694f63c0e9c7c317ff867e1153e2ca32baf6352 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Thu, 20 Mar 2025 16:29:25 -0400 Subject: [PATCH 02/16] test CI fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b67f4a1..3a8fad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Install dependencies run: | cd frontend - npm ci # Ensures a clean install with package-lock.json + npm install # Ensures a clean install with package-lock.json - name: Build Angular app run: | From da41dd240ae5bc8f311416490476d955a3981204 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Thu, 20 Mar 2025 16:33:25 -0400 Subject: [PATCH 03/16] simplified npm cache in test --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a8fad6..5c7050e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '18' # Adjust as needed - cache: 'npm' - name: Install dependencies run: | From c2c87bcff399cbfa0928ef7f388de45af4e84a8d Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Thu, 20 Mar 2025 16:37:25 -0400 Subject: [PATCH 04/16] making sure frontend builds as dev in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c7050e..b89fa17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Build Angular app run: | cd frontend - npm run build + npm run watch backend: name: Deploy Firebase Functions From 02c24a5e4a020e7744f58cdee620746d04581517 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Thu, 20 Mar 2025 16:37:34 -0400 Subject: [PATCH 05/16] making sure frontend builds as dev in CI --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b89fa17..23942b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,4 @@ jobs: - name: Install backend dependencies run: | - pip install -r backend/requirements.txt - - - name: Verify Firebase functions compile - run: | - ./backend/run.sh \ No newline at end of file + pip install -r backend/requirements.txt \ No newline at end of file From 01559c4269e1b354cac5fa44282468d050203dff Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:11:38 -0400 Subject: [PATCH 06/16] package dev fix --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 948a888..7a34586 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,7 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration development", + "watch": "ng build --watch --configuration=development", "test": "ng test", "serve:ssr:TwoCube-Frontend": "node dist/two-cube-frontend/server/server.mjs", "dev": "ng serve --configuration=development", From f004c545bc137aac7bc629314707770cc9afe0ac Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:25:34 -0400 Subject: [PATCH 07/16] Added env file target to CI --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23942b8..918fb76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,18 @@ jobs: cd frontend npm install # Ensures a clean install with package-lock.json + - name: Create environment.ts + run: | + # Navigate to the frontend folder + cd frontend + + # Ensure the environments folder exists (in case it's missing) + mkdir -p src/environments + + # Generate a minimal environment.ts + echo "export const environment = { production: false };" \ + > src/environments/environment.ts + - name: Build Angular app run: | cd frontend From fe9ba88e274654b7291c21bc74a58fb176d8c099 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:29:09 -0400 Subject: [PATCH 08/16] changed to dev build in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 918fb76..84b59bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Build Angular app run: | cd frontend - npm run watch + npm run dev_build backend: name: Deploy Firebase Functions From aca7da1a0b7a5d5904c993608d7d2784cb460e9a Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:32:01 -0400 Subject: [PATCH 09/16] updated dev build script --- frontend/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 7a34586..b76eef2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,8 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration=development", + "dev_build": "ng build --configuration=development", + "watch": "ng build --watch", "test": "ng test", "serve:ssr:TwoCube-Frontend": "node dist/two-cube-frontend/server/server.mjs", "dev": "ng serve --configuration=development", From 8ee99dc68348353a6a8fbd9df541fa78116eecde Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:38:44 -0400 Subject: [PATCH 10/16] made sure backend CI is pointing to right folder --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84b59bf..7d0a8f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,25 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Node.js + - name: Set up Node.js for backend uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' + cache-dependency-path: backend/package-lock.json + + - name: Install backend dependencies + run: | + cd backend + npm install - name: Install Firebase CLI - run: npm install -g firebase-tools + run: | + cd backend + npm install -g firebase-tools + - name: Install backend dependencies run: | + cd backend pip install -r backend/requirements.txt \ No newline at end of file From c51d40f28f8d2b8e819135f2599df1273a436493 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:48:07 -0400 Subject: [PATCH 11/16] test CI flake From b60e0cdaaa216f925f0204b5321c5b525b58297c Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:51:50 -0400 Subject: [PATCH 12/16] npm without cache in CI --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d0a8f9..83bf9e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,8 +49,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '18' - cache: 'npm' - cache-dependency-path: backend/package-lock.json - name: Install backend dependencies run: | From a48420aad3f7e5c692297e30713ce11887e8c8d0 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 22:55:39 -0400 Subject: [PATCH 13/16] simplify backend CI --- .github/workflows/ci.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83bf9e4..7ce3a6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,21 +45,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Node.js for backend - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Install backend dependencies - run: | - cd backend - npm install - - - name: Install Firebase CLI - run: | - cd backend - npm install -g firebase-tools - - name: Install backend dependencies run: | From e3050bf227c5ea3ab98dd5e4a7f21b4c48755b39 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 23:03:34 -0400 Subject: [PATCH 14/16] test CI rate limit flake From 283524736beef656cdd7b757346cb2029ce11630 Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 23:07:47 -0400 Subject: [PATCH 15/16] fixed CI pathing --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ce3a6d..3c23fca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,4 @@ jobs: - name: Install backend dependencies run: | cd backend - pip install -r backend/requirements.txt \ No newline at end of file + pip install -r requirements.txt \ No newline at end of file From 5ee22d8a6871aebc6e1ea0b2da4a956aa97841ce Mon Sep 17 00:00:00 2001 From: Dylan Riffle Date: Wed, 26 Mar 2025 23:11:28 -0400 Subject: [PATCH 16/16] fixing pathing again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c23fca..4c06327 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,4 @@ jobs: - name: Install backend dependencies run: | cd backend - pip install -r requirements.txt \ No newline at end of file + pip install -r functions/requirements.txt \ No newline at end of file