Skip to content

ci(publish): pass GitHub token to registry artifact generation (#84415) #39

ci(publish): pass GitHub token to registry artifact generation (#84415)

ci(publish): pass GitHub token to registry artifact generation (#84415) #39

name: Java CDK Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-24.04
outputs:
java: ${{ steps.changes.outputs.java }}
steps:
- name: Checkout Airbyte
if: github.event_name != 'pull_request'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
filters: |
java:
- 'airbyte-cdk/java/**/*'
- 'airbyte-cdk/bulk/**/*'
# Detect changes in base, extract, and load CDK packages.
# If code changed in a package, we verify the version was bumped
# (i.e. the new version doesn't already exist in Maven).
changes-in-bulk-cdk-packages:
name: Detect Bulk CDK Package Changes
runs-on: ubuntu-24.04
outputs:
base: ${{ steps.changes.outputs.base }}
extract: ${{ steps.changes.outputs.extract }}
load: ${{ steps.changes.outputs.load }}
steps:
- name: Checkout Airbyte
if: github.event_name != 'pull_request'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
filters: |
base:
- 'airbyte-cdk/bulk/core/base/**'
extract:
- 'airbyte-cdk/bulk/core/extract/**'
- 'airbyte-cdk/bulk/toolkits/extract-*/**'
- 'airbyte-cdk/bulk/toolkits/*source*/**'
load:
- 'airbyte-cdk/bulk/core/load/**'
- 'airbyte-cdk/bulk/toolkits/load-*/**'
- 'airbyte-cdk/bulk/toolkits/legacy-task-load*/**'
run-check-bulk-cdk-version:
needs:
- changes-in-bulk-cdk-packages
if: |
needs.changes-in-bulk-cdk-packages.outputs.base == 'true' ||
needs.changes-in-bulk-cdk-packages.outputs.extract == 'true' ||
needs.changes-in-bulk-cdk-packages.outputs.load == 'true'
runs-on: linux-24.04-large # Custom runner, defined in GitHub org settings
name: Bulk CDK version check
timeout-minutes: 60
steps:
- name: Checkout Airbyte
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Java Setup
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: "zulu"
java-version: "21"
- name: Check that base CDK version is incremented
if: needs.changes-in-bulk-cdk-packages.outputs.base == 'true'
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
env:
CI: true
with:
job-id: bulk-cdk-version-check
concurrent: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:checkBaseVersion
- name: Check that extract CDK version is incremented
if: needs.changes-in-bulk-cdk-packages.outputs.extract == 'true'
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
env:
CI: true
with:
job-id: bulk-cdk-version-check
concurrent: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:checkExtractVersion
- name: Check that load CDK version is incremented
if: needs.changes-in-bulk-cdk-packages.outputs.load == 'true'
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
env:
CI: true
with:
job-id: bulk-cdk-version-check
concurrent: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:checkLoadVersion
run-check:
needs:
- changes
if: needs.changes.outputs.java == 'true'
# As of now, 16 cores seems to be enough.
# Any revision upwards should be based on a performance analysis of gradle scans.
# See https://github.com/airbytehq/airbyte/pull/36055 for an example of this,
# which explains why which we went down from 64 cores to 16.
runs-on: linux-24.04-large # Custom runner, defined in GitHub org settings
name: CDK Check
timeout-minutes: 60
steps:
- name: Checkout Airbyte
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Java Setup
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: "zulu"
java-version: "21"
- name: Run Java CDK Tests
uses: burrunan/gradle-cache-action@663fbad34e03c8f12b27f4999ac46e3d90f87eca # v3.0.1
env:
CI: true
with:
job-id: gradle-check
read-only: ${{ github.ref != 'refs/heads/master' }}
gradle-distribution-sha-256-sum-warning: false
concurrent: true
# TODO: be able to remove the skipSlowTests property
arguments: --scan :airbyte-cdk:check -DskipSlowTests=true
bulk-cdk-version-check-result:
name: Bulk CDK version check result
runs-on: ubuntu-24.04
if: always()
needs:
- run-check-bulk-cdk-version
steps:
- name: Report status
run: |
if [[ "${{ needs.run-check-bulk-cdk-version.result }}" == "success" || "${{ needs.run-check-bulk-cdk-version.result }}" == "skipped" ]]; then
exit 0
else
exit 1
fi