Skip to content

BigQuery: storage write API connector #3348

BigQuery: storage write API connector

BigQuery: storage write API connector #3348

name: Integration Tests
on:
schedule:
# Run every day at 1AM UTC
- cron: '0 1 * * *'
pull_request:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
filter:
description: 'Package filter (e.g. aws kafka). Leave empty to run all.'
required: false
default: ''
type: string
jobs:
integration-test:
if: ${{ github.event_name != 'issue_comment' && github.event.inputs.filter == '' && (github.event_name != 'pull_request' || startsWith(github.event.pull_request.title, 'build(deps)')) }}
runs-on: ubuntu-latest-32
env:
CGO_ENABLED: 0
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Install Task
uses: ./.github/actions/setup-task
- name: Pull Latest Redpanda Image
run: task docker:pull-redpanda
- name: Run Integration Tests
run: task test:integration -- --output-dir "${{ runner.temp }}/integration"
timeout-minutes: 120
- name: Write Summary
if: always()
run: |
if [ -f "${{ runner.temp }}/integration/index.md" ]; then
cat "${{ runner.temp }}/integration/index.md" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload Test Output
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-output
path: ${{ runner.temp }}/integration/
retention-days: 7
integration-test-filter:
if: >-
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/integration ')) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.filter != '') ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-integration-tests'))
runs-on: ubuntu-latest-32
env:
CGO_ENABLED: 0
steps:
- name: Check commenter permissions
if: ${{ github.event_name == 'issue_comment' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
PERMISSION=$(gh api "repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission" --jq '.permission')
if [[ "${PERMISSION}" != "admin" && "${PERMISSION}" != "write" ]]; then
echo "::error::User ${{ github.event.comment.user.login }} does not have write access"
exit 1
fi
- name: Parse filter from comment
if: ${{ github.event_name == 'issue_comment' }}
id: parse
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
FILTER=$(echo "${COMMENT_BODY}" | sed 's|^/integration ||')
echo "filter=${FILTER}" >> "$GITHUB_OUTPUT"
- name: Checkout PR branch
if: ${{ github.event_name == 'issue_comment' }}
uses: actions/checkout@v6
with:
ref: refs/pull/${{ github.event.issue.number }}/merge
- name: Checkout code
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Checkout code
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v6
- name: Detect changed packages
if: ${{ github.event_name == 'pull_request' }}
id: detect
run: |
FILTERS=$(
git diff --name-only "$(git merge-base HEAD origin/${{ github.base_ref }})"...HEAD \
| { grep '^internal/impl/' || true; } \
| cut -d/ -f3 \
| sort -u \
| tr '\n' ' '
)
echo "filters=${FILTERS}" >> "$GITHUB_OUTPUT"
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Install Task
uses: ./.github/actions/setup-task
- name: Pull Latest Redpanda Image
run: task docker:pull-redpanda
- name: Run Integration Tests
env:
FILTER: ${{ steps.parse.outputs.filter || steps.detect.outputs.filters || github.event.inputs.filter }}
run: task test:integration -- --output-dir "${{ runner.temp }}/integration" ${FILTER}
timeout-minutes: 30
- name: Write Summary
if: always()
run: |
if [ -f "${{ runner.temp }}/integration/index.md" ]; then
cat "${{ runner.temp }}/integration/index.md" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload Test Output
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-output
path: ${{ runner.temp }}/integration/
retention-days: 7