diff --git a/.github/actions/gradle-command-self-hosted-action/action.yml b/.github/actions/gradle-command-self-hosted-action/action.yml new file mode 100644 index 000000000000..7dd835e1032e --- /dev/null +++ b/.github/actions/gradle-command-self-hosted-action/action.yml @@ -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 }} \ No newline at end of file diff --git a/.github/actions/setup-default-test-properties/action.yml b/.github/actions/setup-default-test-properties/action.yml new file mode 100644 index 000000000000..78144098e285 --- /dev/null +++ b/.github/actions/setup-default-test-properties/action.yml @@ -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)" \ No newline at end of file diff --git a/.github/actions/setup-default-test-properties/test-properties.json b/.github/actions/setup-default-test-properties/test-properties.json new file mode 100644 index 000000000000..6d30acafbb04 --- /dev/null +++ b/.github/actions/setup-default-test-properties/test-properties.json @@ -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"] + } +} \ No newline at end of file diff --git a/.github/actions/setup-self-hosted-action/action.yml b/.github/actions/setup-self-hosted-action/action.yml new file mode 100644 index 000000000000..b268357c08e6 --- /dev/null +++ b/.github/actions/setup-self-hosted-action/action.yml @@ -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: + 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