Skip to content
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

[BSE-4337] Trigger BodoSQL customer tests when changes in BodoSQL/calcite_sql #23

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .github/workflows/java_tests.yml

This file was deleted.

57 changes: 47 additions & 10 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,69 @@ concurrency:
cancel-in-progress: true

jobs:
# 1) Check if commit has [run ci] before continuing
commit-prefix-ci:
name: Get Commit Message

# 1) Validate changes and commit message
validate:
name: Validate
runs-on: ubuntu-latest
outputs:
# https://docs.github.com/en/actions/learn-github-actions/expressions#contains
# contains is case-insensitive
runCI: ${{ contains(steps.check_msg.outputs.commitMsg, '[run ci]') }}
run_tests: ${{ contains(steps.check_msg.outputs.commit_message, '[run ci]') }}
run_bodosql_customer_tests: ${{ steps.changes.outputs.bodosql_customer_tests }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: "0"

- name: Validate Changes
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
bodosql_customer_tests:
- 'BodoSQL/calcite_sql/**'

# Fetch the PR branch for the commit history
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
sparse-checkout: .

- name: Check Commit Message
id: check_msg
run: |
set -xe pipefail
echo "commitMsg=$(git log -1 --pretty=format:'%s')" >> $GITHUB_OUTPUT
echo "commit_message=$(git log -1 --pretty=format:'%s')" >> $GITHUB_OUTPUT

# 2) Trigger BodoSQL Customer tests
bodosql-customer-tests:
needs: [validate]
name: BodoSQL Customer Tests
runs-on: ubuntu-latest
if: |
needs.validate.outputs.run_tests == 'true' &&
needs.validate.outputs.run_bodosql_customer_tests == 'true'

steps:
- uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: bodo-ai
repo: customer-sample-code
github_token: ${{ secrets.BOT_HERMAN_GITHUB_TOKEN }}
workflow_file_name: customer_bodosql_ci.yaml
ref: master
client_payload: '{ "branch" : "${{ github.head_ref || github.ref_name }}" }'


# 2) Pre-Build Bodo to save build artifacts to sccache
# 3) Pre-Build Bodo to save build artifacts to sccache
compile-bodo:
needs: [commit-prefix-ci]
needs: [validate]
name: Pre-Build Bodo for Cache
runs-on: [self-hosted, large]
if: needs.commit-prefix-ci.outputs.runCI == 'true'
if: needs.validate.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- name: Build from Source
Expand All @@ -51,7 +88,7 @@ jobs:
run: |
wget -O hadoop.tar.gz "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=hadoop/common/hadoop-3.3.2/hadoop-3.3.2.tar.gz"

# 3) Actually run tests
# 4) Actually run tests
pr-ci:
needs: [compile-bodo]
name: Test
Expand Down Expand Up @@ -79,7 +116,7 @@ jobs:
collect-coverage: false
secrets: inherit

# 4) Collect and combine any results from runs
# 5) Collect and combine any results from runs
collect-results:
needs: [pr-ci]
name: Collect Results
Expand Down
Loading