Skip to content

Commit 31b7837

Browse files
committed
create new workflow for testing packaging instead.
1 parent e86eb08 commit 31b7837

File tree

2 files changed

+61
-46
lines changed

2 files changed

+61
-46
lines changed

.github/workflows/packaging.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Packaging Tests
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
env:
8+
CI: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 22.x
18+
cache: npm
19+
- run: npm ci
20+
- run: npm run build
21+
- run: npm pack
22+
- name: Upload tarball
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: package-tarball
26+
path: firebase-functions-*.tgz
27+
28+
verify:
29+
needs: build
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
node-version:
34+
- 18.x
35+
- 20.x
36+
- 22.x
37+
- 24.x
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
- name: Download tarball
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: package-tarball
47+
- run: chmod +x ./scripts/test-packaging.sh && ./scripts/test-packaging.sh firebase-functions-*.tgz

.github/workflows/test.yaml

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,6 @@ env:
88
CI: true
99

1010
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
16-
with:
17-
node-version: 22.x
18-
cache: npm
19-
- run: npm ci
20-
- run: npm run build
21-
- run: npm pack
22-
- name: Upload tarball
23-
uses: actions/upload-artifact@v4
24-
with:
25-
name: package-tarball
26-
path: firebase-functions-*.tgz
27-
2811
lint:
2912
runs-on: ubuntu-latest
3013
if: github.event_name == 'pull_request'
@@ -42,7 +25,6 @@ jobs:
4225
cache: npm
4326
- run: npm ci
4427
- run: npm run lint
45-
4628
unit:
4729
runs-on: ubuntu-latest
4830
strategy:
@@ -53,35 +35,17 @@ jobs:
5335
- 22.x
5436
- 24.x
5537
steps:
56-
- uses: actions/checkout@v3
57-
- uses: actions/setup-node@v3
38+
- uses: actions/checkout@v1
39+
- uses: actions/setup-node@v1
5840
with:
5941
node-version: ${{ matrix.node-version }}
60-
cache: npm
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') }}
6147
- run: npm ci
6248
- run: npm run test
63-
64-
packaging:
65-
needs: build
66-
runs-on: ubuntu-latest
67-
strategy:
68-
matrix:
69-
node-version:
70-
- 18.x
71-
- 20.x
72-
- 22.x
73-
- 24.x
74-
steps:
75-
- uses: actions/checkout@v3
76-
- uses: actions/setup-node@v3
77-
with:
78-
node-version: ${{ matrix.node-version }}
79-
- name: Download tarball
80-
uses: actions/download-artifact@v4
81-
with:
82-
name: package-tarball
83-
- run: chmod +x ./scripts/test-packaging.sh && ./scripts/test-packaging.sh firebase-functions-*.tgz
84-
8549
integration:
8650
needs: "unit"
8751
runs-on: ubuntu-latest
@@ -93,10 +57,14 @@ jobs:
9357
- 22.x
9458
- 24.x
9559
steps:
96-
- uses: actions/checkout@v3
97-
- uses: actions/setup-node@v3
60+
- uses: actions/checkout@v1
61+
- uses: actions/setup-node@v1
9862
with:
9963
node-version: ${{ matrix.node-version }}
100-
cache: npm
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') }}
10169
- run: npm ci
10270
- run: npm run test:bin

0 commit comments

Comments
 (0)