Skip to content

Commit

Permalink
airbyte-ci: refactor GradleTask to run in subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed Jan 21, 2025
1 parent f3705c9 commit def2396
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 203 deletions.
32 changes: 32 additions & 0 deletions .github/actions/install-java-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Install Java Environment
description: "Installs the Java environment"
inputs:
java_version:
description: "Java version"
required: false
default: "21"
type: string
gradle_cache_read_only:
description: "Whether to use a read-only Gradle cache"
required: false
default: false
type: boolean
gradle_cache_write_only:
description: "Whether to use a write-only Gradle cache"
required: false
default: false
type: boolean
runs:
using: "composite"
steps:
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: ${{ inputs.java_version }}
- uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ inputs.gradle_cache_read_only }}
cache-write-only: ${{ inputs.gradle_cache_write_only }}
- name: Install system tools (jq, xargs)
shell: bash
run: sudo apt-get -y install jq findutils
4 changes: 3 additions & 1 deletion .github/actions/run-airbyte-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ runs:
ls -la
ls -la airbyte-python-cdk || echo "No airbyte-python-cdk directory"
ls -laL ../airbyte-python-cdk || echo "No airbyte-python-cdk symlink"
- name: Install Java Environment
id: install-java-environment
uses: ./.github/actions/install-java-environment
- name: Docker login
id: docker-login
uses: docker/login-action@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ async def run_connector_build(context: ConnectorContext) -> StepResult:
build_connector_tar_result = await BuildConnectorDistributionTar(context).run()
if build_connector_tar_result.status is not StepStatus.SUCCESS:
return build_connector_tar_result
dist_dir = await build_connector_tar_result.output.directory(dist_tar_directory_path(context))

dist_dir = await build_connector_tar_result.output.directory("build/distributions")
return await BuildConnectorImages(context).run(dist_dir)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ def get_test_steps(context: ConnectorTestContext) -> STEP_TREE:
StepToRun(
id=CONNECTOR_TEST_STEP_ID.BUILD,
step=BuildConnectorImages(context),
args=lambda results: {
"dist_dir": results[CONNECTOR_TEST_STEP_ID.BUILD_TAR].output.directory(dist_tar_directory_path(context))
},
args=lambda results: {"dist_dir": results[CONNECTOR_TEST_STEP_ID.BUILD_TAR].output.directory("build/distributions")},
depends_on=[CONNECTOR_TEST_STEP_ID.BUILD_TAR],
),
],
Expand Down
Loading

0 comments on commit def2396

Please sign in to comment.