Skip to content

Commit 702a602

Browse files
authored
Add CI for firebase-functions-test (#147)
* Add CI for firebase-functions-test This commit adds CI for firebase-functions-test as an additional level of protection. This is a duplicate of the {test.yaml from firebase-functions](https://github.com/firebase/firebase-functions/blob/master/.github/workflows/test.yaml) * Remove `npm run bin:test`; Add `npm run integrationTest` This commit does the following: * Remove `npm run bin:test` from ci * Add `npm run integrationTest` from ci * ran npm run format:fix
1 parent 2ccf0d5 commit 702a602

File tree

2 files changed

+56
-9
lines changed

2 files changed

+56
-9
lines changed

.github/workflows/test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI Tests
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
env:
8+
CI: true
9+
10+
jobs:
11+
unit:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version:
16+
- 14.x
17+
- 16.x
18+
steps:
19+
- uses: actions/checkout@v1
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Cache npm
25+
uses: actions/cache@v1
26+
with:
27+
path: ~/.npm
28+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
29+
30+
- run: npm ci
31+
- run: npm run lint
32+
- run: npm run format
33+
- run: npm run test
34+
integration:
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
node-version:
39+
- 14.x
40+
- 16.x
41+
steps:
42+
- uses: actions/checkout@v1
43+
- uses: actions/setup-node@v1
44+
with:
45+
node-version: ${{ matrix.node-version }}
46+
47+
- name: Cache npm
48+
uses: actions/cache@v1
49+
with:
50+
path: ~/.npm
51+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
52+
53+
- run: npm install
54+
- run: npm run integrationTest

spec/main.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ import { expect } from 'chai';
2424
import * as functions from 'firebase-functions';
2525
import { set } from 'lodash';
2626

27-
import {
28-
mockConfig,
29-
makeChange,
30-
wrap,
31-
} from '../src/main';
32-
import {
33-
_makeResourceName,
34-
_extractParams,
35-
} from '../src/v1';
27+
import { mockConfig, makeChange, wrap } from '../src/main';
28+
import { _makeResourceName, _extractParams } from '../src/v1';
3629
import { features } from '../src/features';
3730
import { FirebaseFunctionsTest } from '../src/lifecycle';
3831
import { alerts } from 'firebase-functions/v2';

0 commit comments

Comments
 (0)