diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index e47f8cd..f9b1365 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -5,6 +5,7 @@ on: push: branches: - master + pull_request: workflow_dispatch: # Declare default permissions as read only. @@ -12,29 +13,32 @@ permissions: read-all jobs: go113-buildpack-test: - uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 + uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4 with: http-builder-source: 'testdata/conformance/function' http-builder-target: 'declarativeHTTP' cloudevent-builder-source: 'testdata/conformance/function' cloudevent-builder-target: 'declarativeCloudEvent' - prerun: 'testdata/conformance/prerun.sh ${{ github.sha }} testdata/conformance/function' + prerun: 'testdata/conformance/prerun.sh ${{ github.event.pull_request.head.sha }} testdata/conformance/function' builder-runtime: 'go113' + builder-runtime-version: '1.13' go116-buildpack-test: - uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 + uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4 with: http-builder-source: 'testdata/conformance/function' http-builder-target: 'declarativeHTTP' cloudevent-builder-source: 'testdata/conformance/function' cloudevent-builder-target: 'declarativeCloudEvent' - prerun: 'testdata/conformance/prerun.sh ${{ github.sha }} testdata/conformance/function' + prerun: 'testdata/conformance/prerun.sh ${{ github.event.pull_request.head.sha }} testdata/conformance/function' builder-runtime: 'go116' + builder-runtime-version: '1.16' non-declarative-buildpack-test: - uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 + uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4 with: http-builder-source: 'testdata/conformance/nondeclarative' http-builder-target: 'HTTP' cloudevent-builder-source: 'testdata/conformance/nondeclarative' cloudevent-builder-target: 'CloudEvent' - prerun: 'testdata/conformance/prerun.sh ${{ github.sha }} testdata/conformance/nondeclarative' - builder-runtime: 'go116' \ No newline at end of file + prerun: 'testdata/conformance/prerun.sh ${{ github.event.pull_request.head.sha }} testdata/conformance/nondeclarative' + builder-runtime: 'go116' + builder-runtime-version: '1.16' \ No newline at end of file diff --git a/testdata/conformance/prerun.sh b/testdata/conformance/prerun.sh index 58b8268..4f713ee 100755 --- a/testdata/conformance/prerun.sh +++ b/testdata/conformance/prerun.sh @@ -14,16 +14,14 @@ TARGET_DIRECTORY=$2 # relative to repo root # exit when any command fails set -e -if [ -z "${FRAMEWORK_VERSION}" ] - then - echo "Functions Framework version required as first parameter" - exit 1 +if [ -z "${FRAMEWORK_VERSION}" ]; then + echo "Functions Framework version required as first parameter" + exit 1 fi -if [ -z "${TARGET_DIRECTORY}" ] - then - echo "Target directory required as second parameter" - exit 1 +if [ -z "${TARGET_DIRECTORY}" ]; then + echo "Target directory required as second parameter" + exit 1 fi cd $(dirname $0) @@ -38,8 +36,11 @@ go 1.13 require ( cloud.google.com/go/functions v1.0.0 - github.com/GoogleCloudPlatform/functions-framework-go $FRAMEWORK_VERSION github.com/cloudevents/sdk-go/v2 v2.6.1 -)" >> $TARGET_DIRECTORY/go.mod +)" >>$TARGET_DIRECTORY/go.mod -cat $TARGET_DIRECTORY/go.mod +cd $TARGET_DIRECTORY + +go get github.com/GoogleCloudPlatform/functions-framework-go@$FRAMEWORK_VERSION + +cat go.mod