Skip to content

Commit

Permalink
chore: run buildpack integration test on pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
kenneth-rosario committed Jul 6, 2023
1 parent f56fc1f commit 2a4c8ed
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,54 @@
name: Buildpack Integration Test
on:
push:
branches:
- master
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"

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

jobs:
python37:
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.3
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 }}'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }} 3.7'
builder-runtime: 'python37'
start-delay: 5
python38:
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.3
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 }}'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }} 3.8'
builder-runtime: 'python38'
start-delay: 5
python39:
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.3
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 }}'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }} 3.9'
builder-runtime: 'python39'
start-delay: 5
python310:
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.3
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 }}'
prerun: 'tests/conformance/prerun.sh ${{ github.sha }} 3.10'
builder-runtime: 'python310'
start-delay: 5
20 changes: 14 additions & 6 deletions tests/conformance/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@
set -e

FRAMEWORK_VERSION=$1
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

PYTHON_VERSION=$2
if [ -z "${PYTHON_VERSION}" ]; then
echo "Python version required as second 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
echo "git+https://github.com/GoogleCloudPlatform/functions-framework-python@$FRAMEWORK_VERSION#egg=functions-framework" >requirements.txt
cat requirements.txt

echo $PYTHON_VERSION >.python-version
cat .python-version

0 comments on commit 2a4c8ed

Please sign in to comment.