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

Skip to content
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
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/buildpack-integration-test.yml@v1.4.1
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/buildpack-integration-test.yml@v1.4.1
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/buildpack-integration-test.yml@v1.4.1
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/buildpack-integration-test.yml@v1.4.1
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