Skip to content

Commit

Permalink
Enable remote gradle cache and build scan for GitHub Actions workflows (
Browse files Browse the repository at this point in the history
#28539)

* publish gradle build scans

publish gradle build scans

publish gradle build scans

* added missing gradle configs

publish gradle build scans
  • Loading branch information
andreydevyatkin authored Sep 20, 2023
1 parent 275b177 commit 93c3224
Show file tree
Hide file tree
Showing 57 changed files with 240 additions and 501 deletions.
2 changes: 2 additions & 0 deletions .github/actions/setup-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ runs:
shell: bash
run: |
echo KUBELET_GCLOUD_CONFIG_PATH=/var/lib/kubelet/pods/$POD_UID/volumes/kubernetes.io~empty-dir/gcloud >> $GITHUB_ENV
- name: Setup environment
uses: ./.github/actions/setup-environment-action
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,42 @@
# 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'
name: 'Setup environment action'
description: 'Setup environment to run jobs'
inputs:
requires-py-38:
python-version:
required: false
description: 'Set as false if does not require py38 setup'
default: 'true'
requires-py-39:
description: 'Install Python version'
default: ''
java-version:
required: false
description: 'Set as false if does not require py39 setup'
default: 'true'
requires-java-8:
description: 'Install Java version'
default: ''
go-version:
required: false
description: 'Set as false if does not require java-8 setup'
default: 'true'
requires-go:
required: false
description: 'Set as false if does not require go setup'
default: 'true'
description: 'Install Go version'
default: ''

runs:
using: "composite"
steps:
- 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' }}
- name: Install Python
if: ${{ inputs.python-version != '' }}
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Set Java Version
if: ${{ inputs.requires-java-8 == 'true' }}
python-version: ${{ inputs.python-version }}
- name: Install Java
if: ${{ inputs.java-version != '' }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Set Go Version
if: ${{ inputs.requires-go == 'true' }}
java-version: ${{ inputs.java-version }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Install Go
if: ${{ inputs.go-version != '' }}
uses: actions/setup-go@v3
with:
go-version: '1.21' # never set patch, to get latest patch releases.
go-version: ${{ inputs.go-version }} # never set patch, to get latest patch releases.
16 changes: 4 additions & 12 deletions .github/workflows/beam_PostCommit_Go_Dataflow_ARM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
- name: Install Java
uses: actions/setup-[email protected]
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
distribution: 'zulu'
java-version: '8'
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
java-version: 8
go-version: 1.21
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Authenticate on GCP
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/beam_PostCommit_Java_Avro_Versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ permissions:
security-events: read
statuses: read

env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
beam_PostCommit_Java_Avro_Versions:
name: ${{matrix.job_name}} (${{matrix.job_phrase}})
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/beam_PostCommit_Java_Examples_Dataflow_ARM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,10 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{matrix.java_version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{matrix.java_version}})
- name: Setup self-hosted
uses: ./.github/actions/setup-self-hosted-action
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
requires-py-38: false
requires-py-39: false
requires-go: false
- name: Set up Java${{ matrix.java_version }}
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: ${{ matrix.java_version }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Authenticate on GCP
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/beam_PostCommit_Java_Examples_Flink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
- name: Install Java
uses: actions/setup-[email protected]
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
distribution: 'zulu'
java-version: '8'
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
java-version: 8
python-version: 3.8
- name: run examplesIntegrationTest script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/beam_PostCommit_Java_IO_Performance_Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,10 @@ jobs:
with:
ref: v2.50.0 #TODO(https://github.com/apache/beam/issues/28330) automate updating this
repository: apache/beam
- name: Install Java
uses: actions/setup-[email protected]
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
java-version: 8
- name: Authenticate on GCP
uses: google-github-actions/setup-gcloud@v0
with:
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/beam_PostCommit_Java_ValidatesRunner_Flink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
- name: Install Java
uses: actions/setup-[email protected]
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
distribution: 'zulu'
java-version: '8'
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
java-version: 8
python-version: 3.8
- name: run validatesRunner script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/beam_PostCommit_Python_Examples_Dataflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: 3.11
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Run examplesPostCommit script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/beam_PostCommit_Python_Examples_Direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/beam_PostCommit_Python_Examples_Flink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/beam_PostCommit_Python_Examples_Spark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/beam_PostCommit_Python_MongoDBIO_IT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: 3.11
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Run mongodbioIT script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand All @@ -97,7 +89,7 @@ jobs:
with:
gradle-command: :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:validatesContainer
arguments: |
-PtestRCDependencies=true \
-PtestRCDependencies=true
-PpythonVersion=${{ matrix.python_version }} \
- name: Archive code coverage results
uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ jobs:
comment_phrase: ${{ matrix.job_phrase }} ${{ matrix.python_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
- name: Install Python
uses: actions/setup-python@v4
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: 8
python-version: ${{ matrix.python_version }}
- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
Expand Down
Loading

0 comments on commit 93c3224

Please sign in to comment.