Skip to content

Commit

Permalink
chore: run buildpack tests on pull (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenneth-rosario committed Jul 12, 2023
1 parent c95d90f commit 8606f4c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:

# Declare default permissions as read only.
permissions: read-all

jobs:
php74-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.1
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'declarativeHttpFunc'
Expand All @@ -20,8 +21,9 @@ jobs:
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
output-file: 'vendor/bin/function_output.json'
builder-runtime: 'php74'
builder-runtime-version: '">=7.4,<7.5"'
php81-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.1
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'declarativeHttpFunc'
Expand All @@ -30,8 +32,9 @@ jobs:
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
output-file: 'vendor/bin/function_output.json'
builder-runtime: 'php81'
builder-runtime-version: '">=8.1,<8.2"'
php82-buildpack-test:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.1
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'declarativeHttpFunc'
Expand All @@ -40,3 +43,4 @@ jobs:
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
output-file: 'vendor/bin/function_output.json'
builder-runtime: 'php82'
builder-runtime-version: '">=8.2,<8.3"'
17 changes: 10 additions & 7 deletions tests/conformance/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ set -e

cd $(dirname $0)

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 "${GITHUB_HEAD_REF}" ]; then
GITHUB_HEAD_REF="main"
fi

echo '{
"require": {
"google/cloud-functions-framework": "dev-main#'${FRAMEWORK_VERSION}'",
"google/cloud-functions-framework": "dev-'${GITHUB_HEAD_REF}'#'${FRAMEWORK_VERSION}'",
"cloudevents/sdk-php": "^1.0"
}
}' > composer.json
}' >composer.json

cat composer.json
cat composer.json

0 comments on commit 8606f4c

Please sign in to comment.