Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: rename master branch to main #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/buildpack-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Buildpack Integration Test
on:
push:
branches:
- master
- main
pull_request:
workflow_dispatch:
# Runs every day on 12:00 AM PST
Expand All @@ -15,7 +15,7 @@ permissions: read-all

jobs:
python37:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
Expand All @@ -26,7 +26,7 @@ jobs:
builder-runtime-version: '3.7'
start-delay: 5
python38:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
Expand All @@ -37,7 +37,7 @@ jobs:
builder-runtime-version: '3.8'
start-delay: 5
python39:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
Expand All @@ -48,7 +48,7 @@ jobs:
builder-runtime-version: '3.9'
start-delay: 5
python310:
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.4
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
with:
http-builder-source: 'tests/conformance'
http-builder-target: 'write_http_declarative'
Expand All @@ -57,4 +57,4 @@ jobs:
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
builder-runtime: 'python310'
builder-runtime-version: '3.10'
start-delay: 5
start-delay: 5
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: ["master"]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: ["main"]
schedule:
- cron: "0 0 * * 1"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python Conformance CI
on:
push:
branches:
- 'master'
- 'main'
pull_request:

# Declare default permissions as read only.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python Lint CI
on:
push:
branches:
- master
- main
pull_request:
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Build distributions
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@54d67ed3c50a769c633f7db8063c9e634709c1b0 # master
uses: pypa/gh-action-pypi-publish@54d67ed3c50a769c633f7db8063c9e634709c1b0 # main
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
schedule:
- cron: '0 */12 * * *'
push:
branches: [ "master" ]
branches: [ "main" ]
workflow_dispatch:

# Declare default permissions as read only.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python Unit CI
on:
push:
branches:
- master
- main
pull_request:
permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def hello_cloud_event(cloud_event):
print(f"Received event with ID: {cloud_event['id']} and data {cloud_event.data}")
```

> Your function is passed a single [CloudEvent](https://github.com/cloudevents/sdk-python/blob/master/cloudevents/sdk/event/v1.py) parameter.
> Your function is passed a single [CloudEvent](https://github.com/cloudevents/sdk-python/blob/main/cloudevents/sdk/event/v1.py) parameter.

Run the following command to run `hello_cloud_event` target locally:

Expand Down Expand Up @@ -302,7 +302,7 @@ After you've written your function, you can simply deploy it from your local mac

### Cloud Run/Cloud Run on GKE

Once you've written your function and added the Functions Framework to your `requirements.txt` file, all that's left is to create a container image. [Check out the Cloud Run quickstart](https://cloud.google.com/run/docs/quickstarts/build-and-deploy) for Python to create a container image and deploy it to Cloud Run. You'll write a `Dockerfile` when you build your container. This `Dockerfile` allows you to specify exactly what goes into your container (including custom binaries, a specific operating system, and more). [Here is an example `Dockerfile` that calls Functions Framework.](https://github.com/GoogleCloudPlatform/functions-framework-python/blob/master/examples/cloud_run_http)
Once you've written your function and added the Functions Framework to your `requirements.txt` file, all that's left is to create a container image. [Check out the Cloud Run quickstart](https://cloud.google.com/run/docs/quickstarts/build-and-deploy) for Python to create a container image and deploy it to Cloud Run. You'll write a `Dockerfile` when you build your container. This `Dockerfile` allows you to specify exactly what goes into your container (including custom binaries, a specific operating system, and more). [Here is an example `Dockerfile` that calls Functions Framework.](https://github.com/GoogleCloudPlatform/functions-framework-python/blob/main/examples/cloud_run_http)

If you want even more control over the environment, you can [deploy your container image to Cloud Run on GKE](https://cloud.google.com/run/docs/quickstarts/prebuilt-deploy-gke). With Cloud Run on GKE, you can run your function on a GKE cluster, which gives you additional control over the environment (including use of GPU-based instances, longer timeouts and more).

Expand Down
2 changes: 1 addition & 1 deletion src/functions_framework/event_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Maps background/legacy event types to their equivalent CloudEvent types.
# For more info on event mappings see
# https://github.com/GoogleCloudPlatform/functions-framework-conformance/blob/master/docs/mapping.md
# https://github.com/GoogleCloudPlatform/functions-framework-conformance/blob/main/docs/mapping.md
_BACKGROUND_TO_CE_TYPE = {
"google.pubsub.topic.publish": "google.cloud.pubsub.topic.v1.messagePublished",
"providers/cloud.pubsub/eventTypes/topic.publish": "google.cloud.pubsub.topic.v1.messagePublished",
Expand Down