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

Skip to content

chore: add GCF buildpack integration test Workflow #129

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
Jun 24, 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
32 changes: 32 additions & 0 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Validates Functions Framework with GCF buildpacks.
name: Buildpack Integration Test
on:
push:
branches:
- main
workflow_dispatch:
jobs:
php74-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.5.4
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'declarativeHttpFunc'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'declarativeCloudEventFunc'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
output-file: 'vendor/bin/function_output.json'
builder-runtime: 'php74'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/php74/builder
builder-tag: 'php74_20220620_7_4_29_RC00'
php81-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.5.4
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'declarativeHttpFunc'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'declarativeCloudEventFunc'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
output-file: 'vendor/bin/function_output.json'
builder-runtime: 'php81'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/php81/builder
builder-tag: 'php81_20220620_8_1_6_RC00'
27 changes: 27 additions & 0 deletions tests/conformance/prerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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` build example command:
# pack build myfn --builder us.gcr.io/fn-img/buildpacks/php74/builder:php74_20220620_7_4_29_RC00 --env GOOGLE_RUNTIME=php74 --env GOOGLE_FUNCTION_TARGET=declarativeHttpFunc --env X_GOOGLE_TARGET_PLATFORM=gcf
FRAMEWORK_VERSION=$1

# exit when any command fails
set -e

cd $(dirname $0)

if [ -z "${FRAMEWORK_VERSION}" ]
then
echo "Functions Framework version required as first parameter"
exit 1
fi

echo '{
"require": {
"google/cloud-functions-framework": "dev-main#'${FRAMEWORK_VERSION}'",
"cloudevents/sdk-php": "^1.0"
}
}' > composer.json

cat composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
# Defaults to the latest version of the repo, which may be ahead of the
# latest release.

# exit when any command fails
set -e

# Change into the repo root
cd $(dirname $0)/../..

CLIENT_VERSION=$1
if [ $CLIENT_VERSION ]; then
CLIENT_VERSION="@$CLIENT_VERSION"
Expand Down
0