Skip to content

Commit d1df3a4

Browse files
authored
chore: add GCF buildpack integration test Workflow (#137)
See [functions-framework-conformance builidpack integration workflow PR](GoogleCloudPlatform/functions-framework-conformance#99) for more information.
1 parent 7025c7b commit d1df3a4

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Validates Functions Framework with GCF buildpacks.
2+
name: Buildpack Integration Test
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
jobs:
9+
ruby30-buildpack-test:
10+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
11+
with:
12+
http-builder-source: 'test/conformance'
13+
http-builder-target: 'http_func'
14+
cloudevent-builder-source: 'test/conformance'
15+
cloudevent-builder-target: 'cloudevent_func'
16+
prerun: 'test/conformance/prerun.sh ${{ github.sha }}'
17+
builder-runtime: 'ruby30'
18+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/ruby30/builder
19+
builder-tag: 'ruby30_20220620_3_0_4_RC00'

test/conformance/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These files are generate dynamically based off the git commit sha
2+
# when trying to build the conformance test function with buildpacks,
3+
# and should not be checked in.
4+
Gemfile
5+
Gemfile.lock

test/conformance/prerun.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# prerun.sh sets up the test function to use the functions framework commit
2+
# specified. This makes the function `pack` buildable with GCF buildpacks.
3+
#
4+
# `pack` build example command:
5+
# 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
6+
FRAMEWORK_VERSION=$1
7+
8+
# exit when any command fails
9+
set -e
10+
11+
cd $(dirname $0)
12+
13+
if [ -z "${FRAMEWORK_VERSION}" ]
14+
then
15+
echo "Functions Framework version required as first parameter"
16+
exit 1
17+
fi
18+
19+
echo "source 'https://rubygems.org'
20+
gem 'functions_framework', github: 'GoogleCloudPlatform/functions-framework-ruby', ref: '$FRAMEWORK_VERSION'" > Gemfile
21+
cat Gemfile
22+
23+
sudo gem install bundler
24+
25+
# Generate a Gemfile.lock without installing any Gems
26+
bundle lock --update
27+
cat Gemfile.lock

0 commit comments

Comments
 (0)