Skip to content

Commit

Permalink
chore: add GCF buildpack integration test Workflow (#185)
Browse files Browse the repository at this point in the history
See [functions-framework-conformance builidpack integration workflow PR](GoogleCloudPlatform/functions-framework-conformance#99) for more information.
  • Loading branch information
anniefu authored Apr 29, 2022
1 parent 0a7937c commit 6c9ce8c
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
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:
python37:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'write_cloud_event_declarative'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'python37'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python37/builder
builder-tag: 'python37_20220426_3_7_12_RC00'
python38:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'write_cloud_event_declarative'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'python38'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python38/builder
builder-tag: 'python38_20220426_3_8_12_RC00'
python39:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'write_cloud_event_declarative'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'python39'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python39/builder
builder-tag: 'python39_20220426_3_9_10_RC00'
python310:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
cloudevent-builder-source: 'tests/conformance'
cloudevent-builder-target: 'write_cloud_event_declarative'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'python310'
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python310/builder
builder-tag: 'python310_20220320_3_10_2_RC00'
21 changes: 21 additions & 0 deletions tests/conformance/prerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# prerun.sh sets up the test function to use the functions framework commit
# specified by generating a `requirements.txt`. This makes the function `pack` buildable
# with GCF buildpacks.
#
# `pack` command example:
# pack build python-test --builder us.gcr.io/fn-img/buildpacks/python310/builder:python310_20220320_3_10_2_RC00 --env GOOGLE_RUNTIME=python310 --env GOOGLE_FUNCTION_TARGET=write_http_declarative
set -e

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

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

cd $SCRIPT_DIR

echo "git+https://github.com/GoogleCloudPlatform/functions-framework-python@$FRAMEWORK_VERSION#egg=functions-framework" > requirements.txt
cat requirements.txt

0 comments on commit 6c9ce8c

Please sign in to comment.