-
Notifications
You must be signed in to change notification settings - Fork 4.6k
airbyte-cdk [python]: re-enable tests in CI #35560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
postamar
merged 5 commits into
master
from
augustin/02-22-airbyte-cdk_python_re-enable_tests_in_CI
Feb 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ad2cbd1
airbyte-cdk [python]: re-enable tests in CI
alafanechere 0fa2369
Update .github/workflows/python_cdk_tests.yml
c218752
Update .github/workflows/python_cdk_tests.yml
e86ce4e
Update .github/workflows/python_cdk_tests.yml
0a04379
Update .github/workflows/python_cdk_tests.yml
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# THIS WORKFLOW SHOULD BE REPLACED BY A CLEANER ONE ONCE THE PYTHON CDK TESTS CAN BE RUN WITH POETRY | ||
name: Python 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: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
python_cdk: ${{ steps.changes.outputs.python_cdk }} | ||
steps: | ||
- name: Checkout Airbyte | ||
if: github.event_name != 'pull_request' | ||
uses: actions/checkout@v3 | ||
- id: changes | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
# Note: expressions within a filter are OR'ed | ||
filters: | | ||
python_cdk: | ||
- 'airbyte-cdk/python/**/*' | ||
run-python-cdk-check: | ||
needs: | ||
- changes | ||
if: needs.changes.outputs.python_cdk == 'true' | ||
runs-on: connector-test-large | ||
name: Python CDK Tests | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout Airbyte | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "21" | ||
- name: Install Pip | ||
run: curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3 | ||
- name: Install Pyenv | ||
run: python3 -m pip install virtualenv --user | ||
- name: Docker login | ||
# Some tests use testcontainers which pull images from DockerHub. | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
- name: cd airbyte-cdk/python | ||
run: cd airbyte-cdk/python | ||
- name: Run Gradle Check | ||
postamar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: burrunan/gradle-cache-action@v1 | ||
env: | ||
CI: true | ||
with: | ||
job-id: gradle-check | ||
postamar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 check -DskipSlowTests=true | ||
postamar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set-instatus-incident-on-failure: | ||
name: Create Instatus Incident on Failure | ||
runs-on: ubuntu-latest | ||
needs: | ||
- run-python-cdk-check | ||
if: ${{ failure() && github.ref == 'refs/heads/master' }} | ||
steps: | ||
- name: Call Instatus Webhook | ||
uses: joelwmale/webhook-action@master | ||
with: | ||
url: ${{ secrets.INSTATUS_CONNECTOR_CI_WEBHOOK_URL }} | ||
body: '{ "trigger": "down", "status": "HASISSUES" }' | ||
|
||
set-instatus-incident-on-success: | ||
name: Create Instatus Incident on Success | ||
runs-on: ubuntu-latest | ||
needs: | ||
- run-python-cdk-check | ||
if: ${{ success() && github.ref == 'refs/heads/master' }} | ||
steps: | ||
- name: Call Instatus Webhook | ||
uses: joelwmale/webhook-action@master | ||
with: | ||
url: ${{ secrets.INSTATUS_CONNECTOR_CI_WEBHOOK_URL }} | ||
body: '{ "trigger": "up" }' | ||
|
||
notify-failure-slack-channel: | ||
name: "Notify Slack Channel on Build Failures" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- run-python-cdk-check | ||
if: ${{ failure() && github.ref == 'refs/heads/master' }} | ||
steps: | ||
- name: Checkout Airbyte | ||
uses: actions/checkout@v3 | ||
- name: Match GitHub User to Slack User | ||
id: match-github-to-slack-user | ||
uses: ./.github/actions/match-github-to-slack-user | ||
env: | ||
AIRBYTE_TEAM_BOT_SLACK_TOKEN: ${{ secrets.SLACK_AIRBYTE_TEAM_READ_USERS }} | ||
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish to OSS Build Failure Slack Channel | ||
uses: abinoda/slack-action@master | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }} | ||
with: | ||
args: >- | ||
{\"channel\":\"C03BEADRPNY\", \"blocks\":[ | ||
{\"type\":\"divider\"}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\" Merge to OSS Master failed! :bangbang: \n\n\"}}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"_merged by_: *${{ github.actor }}* \n\"}}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"<@${{ steps.match-github-to-slack-user.outputs.slack_user_ids }}> \n\"}}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\" :octavia-shocked: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run> :octavia-shocked: \n\"}}, | ||
{\"type\":\"divider\"}]} | ||
|
||
notify-failure-slack-channel-fixed-broken-build: | ||
name: "Notify Slack Channel on Build Fixes" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- run-python-cdk-check | ||
if: success() | ||
steps: | ||
- name: Get Previous Workflow Status | ||
uses: Mercymeilya/[email protected] | ||
id: last_status | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# To avoid clogging up the channel, only publish build success if the previous build was a failure since this means the build was fixed. | ||
- name: Publish Build Fixed Message to OSS Build Failure Slack Channel | ||
if: ${{ steps.last_status.outputs.last_status == 'failure' }} | ||
uses: abinoda/slack-action@master | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }} | ||
with: | ||
args: >- | ||
{\"channel\":\"C03BEADRPNY\", \"blocks\":[ | ||
{\"type\":\"divider\"}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\" OSS Master Fixed! :white_check_mark: \n\n\"}}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"_merged by_: *${{ github.actor }}* \n\"}}, | ||
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\" :octavia-rocket: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run> :octavia-rocket: \n\"}}, | ||
{\"type\":\"divider\"}]} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.