Skip to content

Commit 6c9ce8c

Browse files
authored
chore: add GCF buildpack integration test Workflow (GoogleCloudPlatform#185)
See [functions-framework-conformance builidpack integration workflow PR](GoogleCloudPlatform/functions-framework-conformance#99) for more information.
1 parent 0a7937c commit 6c9ce8c

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Validates Functions Framework with GCF buildpacks.
2+
name: Buildpack Integration Test
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
jobs:
9+
python37:
10+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
11+
with:
12+
http-builder-source: 'tests/conformance'
13+
http-builder-target: 'write_http_declarative'
14+
cloudevent-builder-source: 'tests/conformance'
15+
cloudevent-builder-target: 'write_cloud_event_declarative'
16+
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
17+
builder-runtime: 'python37'
18+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python37/builder
19+
builder-tag: 'python37_20220426_3_7_12_RC00'
20+
python38:
21+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
22+
with:
23+
http-builder-source: 'tests/conformance'
24+
http-builder-target: 'write_http_declarative'
25+
cloudevent-builder-source: 'tests/conformance'
26+
cloudevent-builder-target: 'write_cloud_event_declarative'
27+
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
28+
builder-runtime: 'python38'
29+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python38/builder
30+
builder-tag: 'python38_20220426_3_8_12_RC00'
31+
python39:
32+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
33+
with:
34+
http-builder-source: 'tests/conformance'
35+
http-builder-target: 'write_http_declarative'
36+
cloudevent-builder-source: 'tests/conformance'
37+
cloudevent-builder-target: 'write_cloud_event_declarative'
38+
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
39+
builder-runtime: 'python39'
40+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python39/builder
41+
builder-tag: 'python39_20220426_3_9_10_RC00'
42+
python310:
43+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/[email protected]
44+
with:
45+
http-builder-source: 'tests/conformance'
46+
http-builder-target: 'write_http_declarative'
47+
cloudevent-builder-source: 'tests/conformance'
48+
cloudevent-builder-target: 'write_cloud_event_declarative'
49+
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
50+
builder-runtime: 'python310'
51+
# Latest uploaded tag from us.gcr.io/fn-img/buildpacks/python310/builder
52+
builder-tag: 'python310_20220320_3_10_2_RC00'

tests/conformance/prerun.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# prerun.sh sets up the test function to use the functions framework commit
2+
# specified by generating a `requirements.txt`. This makes the function `pack` buildable
3+
# with GCF buildpacks.
4+
#
5+
# `pack` command example:
6+
# 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
7+
set -e
8+
9+
FRAMEWORK_VERSION=$1
10+
if [ -z "${FRAMEWORK_VERSION}" ]
11+
then
12+
echo "Functions Framework version required as first parameter"
13+
exit 1
14+
fi
15+
16+
SCRIPT_DIR=$(realpath $(dirname $0))
17+
18+
cd $SCRIPT_DIR
19+
20+
echo "git+https://github.com/GoogleCloudPlatform/functions-framework-python@$FRAMEWORK_VERSION#egg=functions-framework" > requirements.txt
21+
cat requirements.txt

0 commit comments

Comments
 (0)