Skip to content

Commit 773e51e

Browse files
committed
fix github workflows.
1 parent 6ed4b25 commit 773e51e

File tree

3 files changed

+60
-68
lines changed

3 files changed

+60
-68
lines changed

.github/workflows/packaging.yaml

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

.github/workflows/test.yaml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,34 @@ jobs:
1414
strategy:
1515
matrix:
1616
node-version:
17-
- 24.x
17+
- 22.x
1818
steps:
19-
- uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
22-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
2321
with:
2422
node-version: ${{ matrix.node-version }}
2523
cache: npm
2624
- run: npm ci
2725
- run: npm run lint
26+
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 22.x
34+
cache: npm
35+
- run: npm ci
36+
- run: npm run build
37+
- run: npm pack
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: build-artifacts
41+
path: |
42+
lib/
43+
firebase-functions-*.tgz
44+
2845
unit:
2946
runs-on: ubuntu-latest
3047
strategy:
@@ -35,19 +52,16 @@ jobs:
3552
- 22.x
3653
- 24.x
3754
steps:
38-
- uses: actions/checkout@v1
39-
- uses: actions/setup-node@v1
55+
- uses: actions/checkout@v4
56+
- uses: actions/setup-node@v4
4057
with:
4158
node-version: ${{ matrix.node-version }}
42-
- name: Cache npm
43-
uses: actions/cache@v4
44-
with:
45-
path: ~/.npm
46-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
59+
cache: npm
4760
- run: npm ci
4861
- run: npm run test
62+
4963
integration:
50-
needs: "unit"
64+
needs: build
5165
runs-on: ubuntu-latest
5266
strategy:
5367
matrix:
@@ -57,14 +71,37 @@ jobs:
5771
- 22.x
5872
- 24.x
5973
steps:
60-
- uses: actions/checkout@v1
61-
- uses: actions/setup-node@v1
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-node@v4
6276
with:
6377
node-version: ${{ matrix.node-version }}
64-
- name: Cache npm
65-
uses: actions/cache@v4
66-
with:
67-
path: ~/.npm
68-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
78+
cache: npm
6979
- run: npm ci
80+
- uses: actions/download-artifact@v4
81+
with:
82+
name: build-artifacts
83+
path: .
7084
- run: npm run test:bin
85+
env:
86+
SKIP_BUILD: true
87+
88+
packaging:
89+
needs: build
90+
runs-on: ubuntu-latest
91+
strategy:
92+
matrix:
93+
node-version:
94+
- 18.x
95+
- 20.x
96+
- 22.x
97+
- 24.x
98+
steps:
99+
- uses: actions/checkout@v4
100+
- uses: actions/setup-node@v4
101+
with:
102+
node-version: ${{ matrix.node-version }}
103+
- uses: actions/download-artifact@v4
104+
with:
105+
name: build-artifacts
106+
path: .
107+
- run: chmod +x ./scripts/test-packaging.sh && ./scripts/test-packaging.sh firebase-functions-*.tgz

scripts/bin-test/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
set -ex # Immediately exit on failure
33

44
# Link the Functions SDK for the testing environment.
5-
npm run build
5+
if [ "$SKIP_BUILD" != "true" ]; then
6+
npm run build
7+
fi
68
npm link
79

810
# Link the extensions SDKs for the testing environment.

0 commit comments

Comments
 (0)