Skip to content

Commit 33a7733

Browse files
alafanecherejatinyadav-cc
authored andcommitted
gradle.yml: use XXL runners but only if gradle related files are changed (airbytehq#35548)
1 parent 6c2fc58 commit 33a7733

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

.github/workflows/gradle.yml

+18-28
Original file line numberDiff line numberDiff line change
@@ -20,62 +20,52 @@ on:
2020
- synchronize
2121

2222
jobs:
23-
run-check:
24-
# The gradle check task which we will run is embarrassingly parallelizable.
25-
# We therefore run this on a machine with a maximum number of cores.
26-
# We pay per time and per core, so there should be little difference in total cost.
27-
# The latency overhead of setting up gradle prior to running the actual task adds up to about a minute.
28-
runs-on: connector-test-large
29-
name: Gradle Check
30-
timeout-minutes: 30
23+
changes:
24+
runs-on: ubuntu-latest
3125
steps:
3226
- name: Checkout Airbyte
3327
uses: actions/checkout@v3
34-
# IMPORTANT! This is necessary to make sure that a status is reported on the PR
35-
# even if the workflow is skipped. If we used github actions filters, the workflow
36-
# would not be reported as skipped, but instead would be forever pending.
37-
#
38-
# I KNOW THIS SOUNDS CRAZY, BUT IT IS TRUE.
39-
#
40-
# Also it gets worse
41-
#
42-
# IMPORTANT! DO NOT CHANGE THE QUOTES AROUND THE GLOBS. THEY ARE REQUIRED.
43-
# MAKE SURE TO TEST ANY SYNTAX CHANGES BEFORE MERGING.
4428
- name: Get changed files
4529
uses: tj-actions/changed-files@v39
4630
id: changes
4731
with:
48-
# Include java connectors and java CDK.
49-
# Adding all *.java and *.gradle files gets us most of the way there.
50-
# We're take a bit more strict for the java CDK, to make sure that
51-
# the tests run when they should, for instance when changing the contents
52-
# of a text file used as a resource.
5332
files_yaml: |
5433
gradlecheck:
5534
- '**/*.java'
5635
- '**/*.gradle'
5736
- 'airbyte-cdk/java/**/*'
37+
outputs:
38+
gradle: ${{ steps.changes.outputs.gradlecheck_any_changed }}
5839

40+
run-check:
41+
needs:
42+
- changes
43+
if: needs.changes.outputs.gradle == 'true'
44+
# The gradle check task which we will run is embarrassingly parallelizable.
45+
# We therefore run this on a machine with a maximum number of cores.
46+
# We pay per time and per core, so there should be little difference in total cost.
47+
# The latency overhead of setting up gradle prior to running the actual task adds up to about a minute.
48+
runs-on: connector-test-xxlarge
49+
name: Gradle Check
50+
timeout-minutes: 30
51+
steps:
52+
- name: Checkout Airbyte
53+
uses: actions/checkout@v3
5954
- uses: actions/setup-java@v3
60-
if: steps.changes.outputs.gradlecheck_any_changed == 'true'
6155
with:
6256
distribution: "zulu"
6357
java-version: "21"
6458
- name: Install Pip
65-
if: steps.changes.outputs.gradlecheck_any_changed == 'true'
6659
run: curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3
6760
- name: Install Pyenv
68-
if: steps.changes.outputs.gradlecheck_any_changed == 'true'
6961
run: python3 -m pip install virtualenv --user
7062
- name: Docker login
71-
if: steps.changes.outputs.gradlecheck_any_changed == 'true'
7263
# Some tests use testcontainers which pull images from DockerHub.
7364
uses: docker/login-action@v1
7465
with:
7566
username: ${{ secrets.DOCKER_HUB_USERNAME }}
7667
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
7768
- name: Run Gradle Check
78-
if: steps.changes.outputs.gradlecheck_any_changed == 'true'
7969
uses: burrunan/gradle-cache-action@v1
8070
env:
8171
CI: true

0 commit comments

Comments
 (0)