Skip to content

Commit 5ffa66c

Browse files
authored
fix: update @types/node version to 24.6.2 and set node engine requirement to 22 (#458)
* fix: update @types/node version to 24.6.2 and set node engine requirement to 22 * fix: remove Node.js version matrix and set fixed version to 22 in reusable GitHub Apps tests * fix: remove Node.js version matrix and set fixed version to 22 in Firebase Functions CI/CD workflow * fix: update @types/node to 24.6.2 and undici-types to 7.13.0 in package-lock.json * fix: update Node.js setup to use .nvmrc for version management in CI workflows * feat: add Firebase Functions deployment check workflow * fix: adjust indentation for consistency in Firebase Functions CI workflow * fix: clarify dependency installation steps in Firebase Functions CI workflow * fix: simplify dependency installation steps in Firebase Functions CI workflow * fix: correct syntax for dependency installation in Firebase Functions CI workflow * fix: update dependency installation command for consistency in Firebase Functions CI workflow * fix: add directory listing step during dependency installation in Firebase Functions CI workflow * fix: add working directory output during dependency installation in Firebase Functions CI workflow * fix: correct directory path for dependency installation in Firebase Functions CI workflow * fix: remove redundant commands and ensure working directory output during dependency installation in Firebase Functions CI workflow * fix: add directory listing and build step during dry-run check in Firebase Functions CI workflow * fix: add verbose flag to firebase-tools emulators:exec for better logging * fix: remove verbose flag from firebase-tools emulators:exec command * fix: reorganize build steps in Firebase Functions CI workflow for clarity * fix: update package dependencies and adjust Node.js engine version * fix: remove redundant build steps for firebase-functions and github-apps in CI workflow * fix: add additional directory navigation and listing in CI workflow for clarity * fix: remove unnecessary build command from Firebase emulator execution * fix: streamline build steps and improve emulator dry-run execution in CI workflow * fix: simplify build commands for firebase-functions and github-apps in CI workflow * fix: add directory listing commands for clarity in emulator dry-run step * fix: update TypeScript configuration for module compatibility and improve import paths * fix: reorder installation of dependencies for clarity in CI workflow * fix: reorder build steps for firebase-functions and github-apps in CI workflow * fix: streamline dependency installation and build steps for clarity in CI workflow * fix: correct command syntax for emulator dry-run step in CI workflow * fix: update dry-run command in CI workflow for emulator to use echo * fix: simplify dry-run check command in CI workflow for firebase functions * fix: remove project flag from dry-run check command in CI workflow for firebase functions * fix: correct dry-run command syntax for emulator in CI workflow * fix: update dry-run command in CI workflow to remove unnecessary flags for emulator * fix: update dry-run command in CI workflow to use echo instead of ls * fix: update dry-run command in CI workflow to include --non-interactive flag * fix: update dry-run command in CI workflow to include emulator execution and correct syntax * fix: streamline installation of dependencies for github-apps in CI workflow * fix: add authentication step and deploy command for firebase functions in CI workflow * fix: escape quotes in deploy command for firebase functions in CI workflow * fix: update deploy step in CI workflow to set environment variables and correct command syntax * fix: add installation step for firebase tools and update deploy command syntax * fix: add --inspect-functions flag to firebase emulators deploy command * fix: add step to write emulator parameters for firebase functions deployment * fix: remove --inspect-functions flag from firebase emulators deploy command
1 parent b297c39 commit 5ffa66c

13 files changed

+123
-64
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Firebase Functions Deploy
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
7+
jobs:
8+
firebase:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: openci-runner/firebase/functions
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version-file: .nvmrc
20+
21+
- name: Install github-apps dependencies
22+
working-directory: openci-runner/github-apps
23+
run: npm ci
24+
25+
- name: Build github-apps
26+
working-directory: openci-runner/github-apps
27+
run: npm run build
28+
29+
- name: Install firebase-functions dependencies
30+
run: npm ci
31+
32+
- name: Build firebase-functions
33+
run: npm run build
34+
35+
- uses: google-github-actions/auth@v2
36+
with:
37+
credentials_json: ${{ secrets.FIREBASE_SA_KEY }}
38+
39+
- name: Install firebase tools
40+
run: npm install -g firebase-tools
41+
42+
- name: Write emulator params
43+
working-directory: openci-runner/firebase/functions
44+
env:
45+
FB_SERVICE_ACCOUNT: ${{ secrets.FB_SERVICE_ACCOUNT }}
46+
GITHUB_PRIVATE_KEY: dummy
47+
GITHUB_WEBHOOK_SECRET: dummy
48+
GITHUB_APP_ID: 1
49+
run: |
50+
cat <<'EOF' > .env.local
51+
FB_SERVICE_ACCOUNT=${FB_SERVICE_ACCOUNT}
52+
GITHUB_PRIVATE_KEY=${GITHUB_PRIVATE_KEY}
53+
GITHUB_WEBHOOK_SECRET=${GITHUB_WEBHOOK_SECRET}
54+
GITHUB_APP_ID=${GITHUB_APP_ID}
55+
EOF
56+
57+
- name: Deploy
58+
working-directory: openci-runner/firebase
59+
run: firebase emulators:exec --only functions "echo ok"

.github/workflows/firebase-functions-ci-cd.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
runs-on: ubuntu-latest
2121
permissions:
2222
contents: read
23-
strategy:
24-
matrix:
25-
node-version: [20, 22]
2623
defaults:
2724
run:
2825
working-directory: openci-runner/firebase/functions
@@ -33,7 +30,11 @@ jobs:
3330
- name: Set up Node.js
3431
uses: actions/setup-node@v4
3532
with:
36-
node-version: ${{ matrix.node-version }}
33+
node-version-file: .nvmrc
34+
35+
- name: Install dependencies for github-apps
36+
working-directory: openci-runner/github-apps
37+
run: npm ci && npm run build
3738

3839
- name: Install dependencies
3940
run: npm ci
@@ -55,7 +56,7 @@ jobs:
5556

5657
- uses: actions/setup-node@v4
5758
with:
58-
node-version: 22
59+
node-version-file: .nvmrc
5960

6061
- uses: google-github-actions/auth@v2
6162
with:

.github/workflows/reusable-github-apps-tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ jobs:
88
runs-on: ubuntu-latest
99
permissions:
1010
contents: read
11-
strategy:
12-
matrix:
13-
node-version: [20, 22]
1411
defaults:
1512
run:
1613
working-directory: openci-runner/github-apps
@@ -21,7 +18,7 @@ jobs:
2118
- name: Set up Node.js
2219
uses: actions/setup-node@v4
2320
with:
24-
node-version: ${{ matrix.node-version }}
21+
node-version-file: .nvmrc
2522

2623
- name: Install dependencies
2724
run: npm ci

.github/workflows/verify-firebase-functions.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

openci-controller.code-workspace

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"nextest",
6464
"nodenext",
6565
"nonexistentkey",
66+
"nvmrc",
6667
"octocrab",
6768
"openci",
6869
"plainaddress",

openci-runner/firebase/functions/package-lock.json

Lines changed: 25 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openci-runner/firebase/functions/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
},
2222
"devDependencies": {
2323
"@types/supertest": "^6.0.3",
24-
"@types/node": "^22.5.0",
24+
"@types/node": "^24.6.2",
2525
"firebase-functions-test": "^3.1.0",
2626
"supertest": "^7.0.0",
2727
"typescript": "^5.9.3",
2828
"vitest": "^3.2.4"
2929
},
30+
"type": "module",
3031
"private": true
3132
}

openci-runner/firebase/functions/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { logger } from "firebase-functions";
33
import { defineInt, defineSecret } from "firebase-functions/params";
44
import { onRequest } from "firebase-functions/v2/https";
55
import { type ApplicationFunction, Probot } from "probot";
6-
import githubApp from "../../../github-apps/src";
6+
import githubApp from "../../../github-apps/lib/index.js";
77

88
const firebaseServiceAccount = defineSecret("FB_SERVICE_ACCOUNT");
99

openci-runner/firebase/functions/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
22
"compilerOptions": {
33
"module": "NodeNext",
4-
"esModuleInterop": true,
4+
"esModuleInterop": false,
55
"moduleResolution": "nodenext",
66
"noImplicitReturns": true,
77
"noUnusedLocals": true,
88
"outDir": "lib",
99
"sourceMap": true,
1010
"strict": true,
1111
"target": "es2022",
12-
"skipLibCheck": true
12+
"skipLibCheck": true,
13+
"allowSyntheticDefaultImports": true
1314
},
15+
"rootDir": "src",
1416
"compileOnSave": true,
1517
"include": [
1618
"src"

0 commit comments

Comments
 (0)