Bump @platformatic/kafka version #1949
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: {} | |
| jobs: | |
| changed-files-job: | |
| name: Get changed packages | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| aws_packages: ${{ steps.detect.outputs.aws_packages }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files: packages/** | |
| - name: Detect changed packages | |
| id: detect | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
| run: | | |
| declare -A PATH_TO_NAME=( | |
| ["packages/amqp"]="@message-queue-toolkit/amqp" | |
| ["packages/core"]="@message-queue-toolkit/core" | |
| ["packages/gcp-pubsub"]="@message-queue-toolkit/gcp-pubsub" | |
| ["packages/gcs-payload-store"]="@message-queue-toolkit/gcs-payload-store" | |
| ["packages/kafka"]="@message-queue-toolkit/kafka" | |
| ["packages/metrics"]="@message-queue-toolkit/metrics" | |
| ["packages/outbox-core"]="@message-queue-toolkit/outbox-core" | |
| ["packages/redis-message-deduplication-store"]="@message-queue-toolkit/redis-message-deduplication-store" | |
| ["packages/s3-payload-store"]="@message-queue-toolkit/s3-payload-store" | |
| ["packages/schemas"]="@message-queue-toolkit/schemas" | |
| ["packages/sns"]="@message-queue-toolkit/sns" | |
| ["packages/sqs"]="@message-queue-toolkit/sqs" | |
| ) | |
| AWS_PACKAGE_PATHS=("packages/sqs" "packages/sns") | |
| PACKAGES=() | |
| AWS_PACKAGES=() | |
| for path in "${!PATH_TO_NAME[@]}"; do | |
| if echo "$ALL_CHANGED_FILES" | grep -q "$path/"; then | |
| is_aws=false | |
| for aws_path in "${AWS_PACKAGE_PATHS[@]}"; do | |
| if [ "$path" = "$aws_path" ]; then | |
| is_aws=true | |
| break | |
| fi | |
| done | |
| if [ "$is_aws" = true ]; then | |
| AWS_PACKAGES+=("\"${PATH_TO_NAME[$path]}\"") | |
| else | |
| PACKAGES+=("\"${PATH_TO_NAME[$path]}\"") | |
| fi | |
| fi | |
| done | |
| if [ ${#PACKAGES[@]} -eq 0 ]; then | |
| echo 'packages=[]' >> $GITHUB_OUTPUT | |
| echo "No non-AWS packages changed" | |
| else | |
| JSON="[$(IFS=,; echo "${PACKAGES[*]}")]" | |
| echo "packages=$JSON" >> $GITHUB_OUTPUT | |
| echo "Changed packages: $JSON" | |
| fi | |
| if [ ${#AWS_PACKAGES[@]} -eq 0 ]; then | |
| echo 'aws_packages=[]' >> $GITHUB_OUTPUT | |
| echo "No AWS packages changed" | |
| else | |
| AWS_JSON="[$(IFS=,; echo "${AWS_PACKAGES[*]}")]" | |
| echo "aws_packages=$AWS_JSON" >> $GITHUB_OUTPUT | |
| echo "Changed AWS packages: $AWS_JSON" | |
| fi | |
| general: | |
| needs: [changed-files-job] | |
| if: needs.changed-files-job.outputs.packages != '[]' | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| node-version: [22.x, 24.x] | |
| package-name: ${{ fromJson(needs.changed-files-job.outputs.packages) }} | |
| uses: ./.github/workflows/ci.common.yml | |
| with: | |
| node_version: ${{ matrix.node-version }} | |
| package_name: ${{ matrix.package-name }} | |
| aws-packages: | |
| needs: [changed-files-job] | |
| if: needs.changed-files-job.outputs.aws_packages != '[]' | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| node-version: [22.x, 24.x] | |
| package-name: ${{ fromJson(needs.changed-files-job.outputs.aws_packages) }} | |
| queue-backend: [fauxqs, localstack] | |
| uses: ./.github/workflows/ci.common.yml | |
| with: | |
| node_version: ${{ matrix.node-version }} | |
| package_name: ${{ matrix.package-name }} | |
| queue_backend: ${{ matrix.queue-backend }} | |
| automerge: | |
| needs: [general, aws-packages] | |
| if: github.event_name == 'pull_request' && always() && (needs.general.result == 'success' || needs.general.result == 'skipped') && (needs.aws-packages.result == 'success' || needs.aws-packages.result == 'skipped') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - uses: fastify/github-action-merge-dependabot@30c3f8f14a4f7b315ba38dbc1b793d27128fef82 # v3.12.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |