Skip to content
Closed
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
76 changes: 76 additions & 0 deletions .github/workflows/job-precommit-python-dataframe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# To learn more about GitHub Actions in Apache Beam check the CI.md

# Runs PreCommit Python Dataframe scheduled on cron, on push to master and on pull request

name: PreCommit Python Dataframe

on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
push:
branches: ['master', 'release-*']
tags: 'v*'
pull_request_target:
branches: ['master', 'release-*']
tags: 'v*'
paths: [ 'sdks/python/apache_beam/dataframe/**']
permissions: read-all

jobs:
set-properties:
runs-on: [self-hosted, ubuntu-20.04]
outputs:
properties: ${{ steps.test-properties.outputs.properties }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
submodules: false
- id: test-properties
uses: ./.github/actions/setup-default-test-properties

precommit_python_dataframe:
needs: set-properties
name: PreCommit Python Dataframe
runs-on: [self-hosted, ubuntu-20.04]
strategy:
fail-fast: false
matrix:
version: ${{fromJson(needs.set-properties.outputs.properties).PythonTestProperties.ALL_SUPPORTED_VERSIONS}}
tox-env: ${{fromJson(needs.set-properties.outputs.properties).PythonTestProperties.TOX_ENV}}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
submodules: false
- name: Set python version
run: echo "PYTHON_VERSION=$(echo ${{ matrix.version }} | sed -e 's/\.//g')" >> $GITHUB_ENV
- name: Setup environment
uses: ./.github/actions/setup-self-hosted-action
- name: Run :sdks:python:test-suites:tox:py${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}${{matrix.tox-env}}
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :sdks:python:test-suites:tox:py${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}${{matrix.tox-env}}
arguments: "-Pposargs=apache_beam/dataframe/"
18 changes: 18 additions & 0 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,26 @@ Service Account shall have following permissions ([IAM roles](https://cloud.goog
| Java Wordcount Direct Runner | Runs Java WordCount example with Direct Runner. | Yes | Yes | Yes | - |
| Java Wordcount Dataflow | Runs Java WordCount example with DataFlow Runner. | - | Yes | Yes | Yes |

### All migrated workflows run based on the following triggers

| Description | Pull Request Run | Direct Push/Merge Run | Scheduled Run | Workflow Dispatch |
|-------------|------------------|-----------------------|---------------|-------------------|
| PostCommit | No | Yes | Yes | Yes |
| PreCommit | Yes | Yes | Yes | Yes |

### PreCommit Workflows
| Workflow | Description | Requires GCP Credentials |
|--------------------------------------------------------------------------------------------|---------------------------------|--------------------------|
| [job-precommit-python-dataframe.yml](.github/workflows/job-precommit-python-dataframe.yml) | Runs Python PreCommit Dataframe | No |

### PostCommit Workflows
| Workflow | Description | Requires GCP Credentials |
|------------------------------------------------------------------------------------|-------------------------|--------------------------|
| [job-postcommit-placeholder.yml](.github/workflows/job-postcommit-placeholder.yml) | Description placeholder | Yes/No |

### GitHub Action Tips

* All migrated workflows get executed on **pre-configured self-hosted** runners. For this reason, GCP credentials are **only** needed when running the workflows in a different runner.
* If you introduce changes to the workflow it is possible that your changes will not be present in the check run triggered in Pull Request.
In this case please attach link to the modified workflow run executed on your fork.
* Possible timeouts with macOS runner - existing issue: [(X) This check failed - sometimes happens on macOS runner #841](https://github.com/actions/virtual-environments/issues/841)
Expand Down