-
Notifications
You must be signed in to change notification settings - Fork 4.5k
GA migration - Base actions to use for precommit and postcommit workflows #23109
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b648d5
Base actions to use for precommit and postcommit workflows
benEng 774f5f8
Adding Java, Flink, Spark and Golang supported versions to json file
fernando-wizeline d8689ee
switching to temurin due to Apache License compatibility
fernando-wizeline d82c234
setting go version to 1.18
fernando-wizeline 53384e0
Add environment as optionals in setup-base-action
benEng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
.github/actions/gradle-command-self-hosted-action/action.yml
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
| 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 }} |
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
| 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
23
.github/actions/setup-default-test-properties/test-properties.json
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
| 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"] | ||
| } | ||
| } |
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
| 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: | ||
| 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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.