platformatic-kafka 1.29 (#413) #1728
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: | |
| jobs: | |
| changed-files-job: | |
| name: Get changed packages | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| aws_packages: ${{ steps.detect.outputs.aws_packages }} | |
| steps: | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4 | |
| 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 != '[]' | |
| 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 != '[]' | |
| 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: 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@v3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |