8000 chore: add GCF buildpack integration test Workflow by anniefu · Pull Request #458 · GoogleCloudPlatform/functions-framework-nodejs · GitHub
[go: up one dir, main page]

Skip to content

chore: add GCF buildpack integration test Workflow #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Validates Functions Framework with GCF buildpacks.
name: Buildpack Integration Test
on:
push:
branches:
- master
workflow_dispatch:
jobs:
nodejs10:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: 'test/conformance'
http-builder-target: 'writeHttpDeclarative'
cloudevent-builder-source: 'test/conformance'
cloudevent-builder-target: 'writeCloudEventDeclarative'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'nodejs10'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs10/builder
builder-tag: 'nodejs10_20220320_10_24_1_RC00'
nodejs12:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: 'test/conformance'
http-builder-target: 'writeHttpDeclarative'
cloudevent-builder-source: 'test/conformance'
cloudevent-builder-target: 'writeCloudEventDeclarative'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'nodejs12'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs12/builder
builder-tag: 'nodejs12_20220320_12_22_9_RC00'
nodejs14:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: 'test/conformance'
http-builder-target: 'writeHttpDeclarative'
cloudevent-builder-source: 'test/conformance'
cloudevent-builder-target: 'writeCloudEventDeclarative'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'nodejs14'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs16/builder
builder-tag: 'nodejs14_20220320_14_18_3_RC00'
nodejs16:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: 'test/conformance'
http-builder-target: 'writeHttpDeclarative'
cloudevent-builder-source: 'test/conformance'
cloudevent-builder-target: 'writeCloudEventDeclarative'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'nodejs16'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/nodejs16/builder
builder-tag: 'nodejs16_20220320_16_13_2_RC00'
2 changes: 2 additions & 0 deletions test/conformance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by prerun.sh for buildpack integration test
google-cloud-functions-framework-0.0.0.tgz
21 changes: 21 additions & 0 deletions test/conformance/prerun.sh
69FA
Original file line number Diff line numberDiff line change
@@ -0,0 +1,21 @@
# prerun.sh sets up the test function to use the functions framework commit
# specified by generating a `package.json`. This makes the function `pack` buildable
# with GCF buildpacks.
#
# `pack` command example:
# 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
set -e

SCRIPT_DIR=$(dirname $0)
REPO_ROOT=$SCRIPT_DIR/../..

cd $REPO_ROOT

npm install gts
npm version 0.0.0 --allow-same-version --no-git-tag-version # fake a deterministic version for testing
npm pack --pack-destination $SCRIPT_DIR

cd $SCRIPT_DIR

npm install google-cloud-functions-framework-0.0.0.tgz
cat package.json
0