|
20 | 20 | - synchronize
|
21 | 21 |
|
22 | 22 | 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 |
31 | 25 | steps:
|
32 | 26 | - name: Checkout Airbyte
|
33 | 27 | 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. |
44 | 28 | - name: Get changed files
|
45 | 29 | uses: tj-actions/changed-files@v39
|
46 | 30 | id: changes
|
47 | 31 | 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. |
53 | 32 | files_yaml: |
|
54 | 33 | gradlecheck:
|
55 | 34 | - '**/*.java'
|
56 | 35 | - '**/*.gradle'
|
57 | 36 | - 'airbyte-cdk/java/**/*'
|
| 37 | + outputs: |
| 38 | + gradle: ${{ steps.changes.outputs.gradlecheck_any_changed }} |
58 | 39 |
|
| 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 |
59 | 54 | - uses: actions/setup-java@v3
|
60 |
| - if: steps.changes.outputs.gradlecheck_any_changed == 'true' |
61 | 55 | with:
|
62 | 56 | distribution: "zulu"
|
63 | 57 | java-version: "21"
|
64 | 58 | - name: Install Pip
|
65 |
| - if: steps.changes.outputs.gradlecheck_any_changed == 'true' |
66 | 59 | run: curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3
|
67 | 60 | - name: Install Pyenv
|
68 |
| - if: steps.changes.outputs.gradlecheck_any_changed == 'true' |
69 | 61 | run: python3 -m pip install virtualenv --user
|
70 | 62 | - name: Docker login
|
71 |
| - if: steps.changes.outputs.gradlecheck_any_changed == 'true' |
72 | 63 | # Some tests use testcontainers which pull images from DockerHub.
|
73 | 64 | uses: docker/login-action@v1
|
74 | 65 | with:
|
75 | 66 | username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
76 | 67 | password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
77 | 68 | - name: Run Gradle Check
|
78 |
| - if: steps.changes.outputs.gradlecheck_any_changed == 'true' |
79 | 69 | uses: burrunan/gradle-cache-action@v1
|
80 | 70 | env:
|
81 | 71 | CI: true
|
|
0 commit comments