Skip to content
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

chore: add GCF buildpack integration test Workflow #137

Merged
merged 1 commit into from
Jul 1, 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
19 changes: 19 additions & 0 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Validates Functions Framework with GCF buildpacks.
name: Buildpack Integration Test
on:
push:
branches:
- main
workflow_dispatch:
jobs:
ruby30-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
with:
http-builder-source: 'test/conformance'
http-builder-target: 'http_func'
cloudevent-builder-source: 'test/conformance'
cloudevent-builder-target: 'cloudevent_func'
prerun: 'test/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'ruby30'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/ruby30/builder
builder-tag: 'ruby30_20220620_3_0_4_RC00'
5 changes: 5 additions & 0 deletions test/conformance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These files are generate dynamically based off the git commit sha
# when trying to build the conformance test function with buildpacks,
# and should not be checked in.
Gemfile
Gemfile.lock
27 changes: 27 additions & 0 deletions test/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. This makes the function `pack` buildable with GCF buildpacks.
#
# `pack` build example command:
# pack build myfn --verbose --builder us.gcr.io/fn-img/buildpacks/ruby30/builder:ruby30_20220620_3_0_4_RC00 --env GOOGLE_RUNTIME=ruby30 --env GOOGLE_FUNCTION_TARGET=http_func --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 "source 'https://rubygems.org'
gem 'functions_framework', github: 'GoogleCloudPlatform/functions-framework-ruby', ref: '$FRAMEWORK_VERSION'" > Gemfile
cat Gemfile

sudo gem install bundler
anniefu marked this conversation as resolved.
Show resolved Hide resolved

# Generate a Gemfile.lock without installing any Gems
bundle lock --update
cat Gemfile.lock