Skip to content

Commit c0766ef

Browse files
authored
chore: add GCF buildpack integration test Workflow (#458)
1 parent 6fdb59b commit c0766ef

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Validates Functions Framework with GCF buildpacks.
2+
name: Buildpack Integration Test
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
jobs:
9+
nodejs10:
10+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
11+
with:
12+
http-builder-source: 'test/conformance'
13+
http-builder-target: 'writeHttpDeclarative'
14+
cloudevent-builder-source: 'test/conformance'
15+
cloudevent-builder-target: 'writeCloudEventDeclarative'
16+
prerun: 'test/conformance/prerun.sh'
17+
builder-runtime: 'nodejs10'
18+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs10/builder
19+
builder-tag: 'nodejs10_20220320_10_24_1_RC00'
20+
nodejs12:
21+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
22+
with:
23+
http-builder-source: 'test/conformance'
24+
http-builder-target: 'writeHttpDeclarative'
25+
cloudevent-builder-source: 'test/conformance'
26+
cloudevent-builder-target: 'writeCloudEventDeclarative'
27+
prerun: 'test/conformance/prerun.sh'
28+
builder-runtime: 'nodejs12'
29+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs12/builder
30+
builder-tag: 'nodejs12_20220320_12_22_9_RC00'
31+
nodejs14:
32+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
33+
with:
34+
http-builder-source: 'test/conformance'
35+
http-builder-target: 'writeHttpDeclarative'
36+
cloudevent-builder-source: 'test/conformance'
37+
cloudevent-builder-target: 'writeCloudEventDeclarative'
38+
prerun: 'test/conformance/prerun.sh'
39+
builder-runtime: 'nodejs14'
40+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs16/builder
41+
builder-tag: 'nodejs14_20220320_14_18_3_RC00'
42+
nodejs16:
43+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
44+
with:
45+
http-builder-source: 'test/conformance'
46+
http-builder-target: 'writeHttpDeclarative'
47+
cloudevent-builder-source: 'test/conformance'
48+
cloudevent-builder-target: 'writeCloudEventDeclarative'
49+
prerun: 'test/conformance/prerun.sh'
50+
builder-runtime: 'nodejs16'
51+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs16/builder
52+
builder-tag: 'nodejs16_20220320_16_13_2_RC00'

test/conformance/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by prerun.sh for buildpack integration test
2+
google-cloud-functions-framework-0.0.0.tgz

test/conformance/prerun.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# prerun.sh sets up the test function to use the functions framework commit
2+
# specified by generating a `package.json`. This makes the function `pack` buildable
3+
# with GCF buildpacks.
4+
#
5+
# `pack` command example:
6+
# pack build test-fast --builder us.gcr.io/fn-img/buildpacks/nodejs16/builder:nodejs16_20220320_16_13_2_RC00 --env GOOGLE_RUNTIME=nodejs16 --env GOOGLE_FUNCTION_TARGET=writeHttpDeclarativ
7+
set -e
8+
9+
SCRIPT_DIR=$(dirname $0)
10+
REPO_ROOT=$SCRIPT_DIR/../..
11+
12+
cd $REPO_ROOT
13+
14+
npm install gts
15+
npm version 0.0.0 --allow-same-version --no-git-tag-version # fake a deterministic version for testing
16+
npm pack --pack-destination $SCRIPT_DIR
17+
18+
cd $SCRIPT_DIR
19+
20+
npm install google-cloud-functions-framework-0.0.0.tgz
21+
cat package.json

0 commit comments

Comments
 (0)