Skip to content
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
45 changes: 45 additions & 0 deletions .github/actions/gradle-command-self-hosted-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.

name: 'Gradle command'
description: 'Configuration actions to run a gradle command in self-hosted runner'
inputs:
gradle-command:
required: true
arguments:
required: false
description: 'Gradle options'
default: ''
default-arguments:
required: false
description: 'Default gradle switches' # Copied from CommonJobProperties.groovy'
default: |
--continue -Dorg.gradle.jvmargs=-Xms2g -Dorg.gradle.jvmargs=-Xmx6g \
-Dorg.gradle.vfs.watch=false -Pdocker-pull-licenses
max-workers:
required: false
description: 'Max number of workers'
default: 8

runs:
using: "composite"
steps:
- name: Run Gradle Command
shell: bash
run: |
./gradlew ${{ inputs.gradle-command }} --max-workers=${{ inputs.max-workers }} ${{ inputs.arguments }} \
${{ inputs.default-arguments }}
31 changes: 31 additions & 0 deletions .github/actions/setup-default-test-properties/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.

name: 'Setup TestProperties'
description: 'Setup default test properties from a Json config file'
outputs:
properties:
description: "Test properties"
value: ${{ steps.test-properties-json.outputs.test-properties }}
runs:
using: "composite"
steps:
- id: test-properties-json
shell: bash
run: |
JSON=$(cat ./.github/actions/setup-default-test-properties/test-properties.json)
echo "::set-output name=test-properties::$(echo $JSON)"
23 changes: 23 additions & 0 deletions .github/actions/setup-default-test-properties/test-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"PythonTestProperties": {
"ALL_SUPPORTED_VERSIONS": ["3.7", "3.8", "3.9"],
"LOWEST_SUPPORTED": ["3.7"],
"HIGHEST_SUPPORTED": ["3.9"],
"ESSENTIAL_VERSIONS": ["3.7", "3.9"],
"CROSS_LANGUAGE_VALIDATES_RUNNER_PYTHON_VERSIONS": ["3.7", "3.9"],
"CROSS_LANGUAGE_VALIDATES_RUNNER_DATAFLOW_USING_SQL_PYTHON_VERSIONS": ["3.9"],
"VALIDATES_CONTAINER_DATAFLOW_PYTHON_VERSIONS": ["3.7", "3.8", "3.9"],
"LOAD_TEST_PYTHON_VERSION": "3.7",
"CHICAGO_TAXI_EXAMPLE_FLINK_PYTHON_VERSION": "3.7",
"DEFAULT_INTERPRETER": "python3.8",
"TOX_ENV": ["Cloud", "Cython"]
},
"JavaTestProperties": {
"SUPPORTED_VERSIONS": ["8", "11", "17"],
"FLINK_VERSIONS": ["1.13", "1.14", "1.15"],
"SPARK_VERSIONS": ["2", "3"]
},
"GoTestProperties": {
"SUPPORTED_VERSIONS": ["1.18"]
}
}
77 changes: 77 additions & 0 deletions .github/actions/setup-self-hosted-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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.

name: 'Setup environment for self-hosted runners'
description: 'Setup action to run jobs in a self-hosted runner'
inputs:
requires-py-37:
required: false
description: 'Set as false if does not require py37 setup'
default: 'true'
requires-py-38:
required: false
description: 'Set as false if does not require py38 setup'
default: 'true'
requires-py-39:
required: false
description: 'Set as false if does not require py39 setup'
default: 'true'
requires-java-8:
required: false
description: 'Set as false if does not require java-8 setup'
default: 'true'
requires-go-18:
required: false
description: 'Set as false if does not require go-18 setup'
default: 'true'

runs:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some optional inputs like:

inputs:
  requires-py-37:
    required: false
    default: 'true'
  requires-py-38:
    required: false
    default: 'true'
  requires-py-39:
    required: false
    default: 'true'
  requires-java-8:
    required: false
    default: 'true'
  requires-go-16:
    required: false
    default: 'true'

So that a given job can specify if it doesn't need some set of dependencies. I agree installing all of them by default is a good idea though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Danny!
We can definitely add those inputs to this action so that further workflows can make use of them.

using: "composite"
steps:
- name: Install python 3.7
if: ${{ inputs.requires-py-37 == 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install python 3.8
if: ${{ inputs.requires-py-38 == 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install python 3.9
if: ${{ inputs.requires-py-39 == 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Set Java Version
if: ${{ inputs.requires-java-8 == 'true' }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Set Go Version
if: ${{ inputs.requires-go-18 == 'true' }}
uses: actions/setup-go@v3
with:
go-version: '1.18.0'
- name: Remove default github maven configuration
if: ${{ inputs.requires-java-8 == 'true' }}
# This step is a workaround to avoid a decryption issue of Beam's
# gradle-command-action plugin and github's provided maven
# settings.xml file
shell: bash
run: rm ~/.m2/settings.xml