Skip to content

chore: add GCF buildpack integration test Workflow #127

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

Closed
wants to merge 2 commits into from
Closed
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
30 changes: 30 additions & 0 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Validates Functions Framework with GCF buildpacks.
name: Buildpack Integration Test
on:
push:
branches:
- master
workflow_dispatch:
jobs:
php74:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: '/tests/conformance/index.php'
http-builder-target: 'declarativeHttpFunc'
cloudevent-builder-source: '/tests/conformance/index.php'
cloudevent-builder-target: 'declarativeCloudEventFunc'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'php74'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/php74/builder
builder-tag: 'php74_20220531_7_4_29_RC00'
php81:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.4.1
with:
http-builder-source: '/tests/conformance/index.php'
http-builder-target: 'declarativeHttpFunc'
cloudevent-builder-source: '/tests/conformance/index.php'
cloudevent-builder-target: 'declarativeCloudEventFunc'
prerun: 'test/conformance/prerun.sh'
builder-runtime: 'php81'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/php81/builder
builder-tag: 'php81_20220530_8_1_6_RC00'
6 changes: 6 additions & 0 deletions tests/conformance/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require": {
"google/cloud-functions-framework": "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change:

"google/cloud-functions-framework": "https://github.com/GoogleCloudPlatform/functions-framework-php/#commit=abc"

Need to pass SHA to this file.

},
"minimum-stability": "dev"
}
12 changes: 12 additions & 0 deletions tests/conformance/prerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# prerun.sh sets up the test function to use the functions framework commit
# specified by generating a `composer.json`. This makes the function `pack` buildable
# with GCF buildpacks.
#
# `pack` command example:
# pack build test-fast --builder us.gcr.io/fn-img/buildpacks/php74/builder:php74_20220531_7_4_29_RC00 --env GOOGLE_RUNTIME=php74 --env GOOGLE_FUNCTION_TARGET=declarativeHttpFunc
set -e

SCRIPT_DIR=$(realpath $(dirname $0))
cd $SCRIPT_DIR

composer install