refactor: replace --gateway flag with --asgi boolean flag (#383) #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Conformance CI (asgi) | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
files.pythonhosted.org:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
proxy.golang.org:443 | |
pypi.org:443 | |
storage.googleapis.com:443 | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install the framework with async extras | |
run: python -m pip install -e .[async] | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version: '1.24' | |
- name: Run HTTP conformance tests | |
uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # v1.8.6 | |
with: | |
functionType: 'http' | |
useBuildpacks: false | |
validateMapping: false | |
cmd: "'functions-framework --source tests/conformance/async_main.py --target write_http --signature-type http --asgi'" | |
- name: Run CloudEvents conformance tests | |
uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # v1.8.6 | |
with: | |
functionType: 'cloudevent' | |
useBuildpacks: false | |
validateMapping: false | |
cmd: "'functions-framework --source tests/conformance/async_main.py --target write_cloud_event --signature-type cloudevent --asgi'" | |
- name: Run HTTP conformance tests declarative | |
uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # v1.8.6 | |
with: | |
functionType: 'http' | |
useBuildpacks: false | |
validateMapping: false | |
cmd: "'functions-framework --source tests/conformance/async_main.py --target write_http_declarative --asgi'" | |
- name: Run CloudEvents conformance tests declarative | |
uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # v1.8.6 | |
with: | |
functionType: 'cloudevent' | |
useBuildpacks: false | |
validateMapping: false | |
cmd: "'functions-framework --source tests/conformance/async_main.py --target write_cloud_event_declarative --asgi'" | |
- name: Run HTTP concurrency tests declarative | |
uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # v1.8.6 | |
with: | |
functionType: 'http' | |
useBuildpacks: false | |
validateConcurrency: true | |
cmd: "'functions-framework --source tests/conformance/async_main.py --target write_http_declarative_concurrent --asgi'" | |
# Note: Event (legacy) and Typed tests are not supported in ASGI mode | |
# Note: validateMapping is set to false for CloudEvent tests because ASGI mode | |
# does not support automatic conversion from legacy events to CloudEvents |