|
12 | 12 | runs-on: ubuntu-latest |
13 | 13 | outputs: |
14 | 14 | packages: ${{ steps.detect.outputs.packages }} |
| 15 | + aws_packages: ${{ steps.detect.outputs.aws_packages }} |
15 | 16 | steps: |
16 | 17 | - name: Get changed files |
17 | 18 | id: changed-files |
@@ -39,22 +40,45 @@ jobs: |
39 | 40 | ["packages/sqs"]="@message-queue-toolkit/sqs" |
40 | 41 | ) |
41 | 42 |
|
| 43 | + AWS_PACKAGE_PATHS=("packages/sqs" "packages/sns") |
| 44 | +
|
42 | 45 | PACKAGES=() |
| 46 | + AWS_PACKAGES=() |
43 | 47 | for path in "${!PATH_TO_NAME[@]}"; do |
44 | 48 | if echo "$ALL_CHANGED_FILES" | grep -q "$path/"; then |
45 | | - PACKAGES+=("\"${PATH_TO_NAME[$path]}\"") |
| 49 | + is_aws=false |
| 50 | + for aws_path in "${AWS_PACKAGE_PATHS[@]}"; do |
| 51 | + if [ "$path" = "$aws_path" ]; then |
| 52 | + is_aws=true |
| 53 | + break |
| 54 | + fi |
| 55 | + done |
| 56 | + if [ "$is_aws" = true ]; then |
| 57 | + AWS_PACKAGES+=("\"${PATH_TO_NAME[$path]}\"") |
| 58 | + else |
| 59 | + PACKAGES+=("\"${PATH_TO_NAME[$path]}\"") |
| 60 | + fi |
46 | 61 | fi |
47 | 62 | done |
48 | 63 |
|
49 | 64 | if [ ${#PACKAGES[@]} -eq 0 ]; then |
50 | 65 | echo 'packages=[]' >> $GITHUB_OUTPUT |
51 | | - echo "No packages changed" |
| 66 | + echo "No non-AWS packages changed" |
52 | 67 | else |
53 | 68 | JSON="[$(IFS=,; echo "${PACKAGES[*]}")]" |
54 | 69 | echo "packages=$JSON" >> $GITHUB_OUTPUT |
55 | 70 | echo "Changed packages: $JSON" |
56 | 71 | fi |
57 | 72 |
|
| 73 | + if [ ${#AWS_PACKAGES[@]} -eq 0 ]; then |
| 74 | + echo 'aws_packages=[]' >> $GITHUB_OUTPUT |
| 75 | + echo "No AWS packages changed" |
| 76 | + else |
| 77 | + AWS_JSON="[$(IFS=,; echo "${AWS_PACKAGES[*]}")]" |
| 78 | + echo "aws_packages=$AWS_JSON" >> $GITHUB_OUTPUT |
| 79 | + echo "Changed AWS packages: $AWS_JSON" |
| 80 | + fi |
| 81 | +
|
58 | 82 | general: |
59 | 83 | needs: [changed-files-job] |
60 | 84 | if: needs.changed-files-job.outputs.packages != '[]' |
|
67 | 91 | node_version: ${{ matrix.node-version }} |
68 | 92 | package_name: ${{ matrix.package-name }} |
69 | 93 |
|
| 94 | + aws-packages: |
| 95 | + needs: [changed-files-job] |
| 96 | + if: needs.changed-files-job.outputs.aws_packages != '[]' |
| 97 | + strategy: |
| 98 | + matrix: |
| 99 | + node-version: [22.x, 24.x] |
| 100 | + package-name: ${{ fromJson(needs.changed-files-job.outputs.aws_packages) }} |
| 101 | + queue-backend: [fauxqs, localstack] |
| 102 | + uses: ./.github/workflows/ci.common.yml |
| 103 | + with: |
| 104 | + node_version: ${{ matrix.node-version }} |
| 105 | + package_name: ${{ matrix.package-name }} |
| 106 | + queue_backend: ${{ matrix.queue-backend }} |
| 107 | + |
70 | 108 | automerge: |
71 | | - needs: [general] |
72 | | - if: always() && (needs.general.result == 'success' || needs.general.result == 'skipped') |
| 109 | + needs: [general, aws-packages] |
| 110 | + if: always() && (needs.general.result == 'success' || needs.general.result == 'skipped') && (needs.aws-packages.result == 'success' || needs.aws-packages.result == 'skipped') |
73 | 111 | runs-on: ubuntu-latest |
74 | 112 | permissions: |
75 | 113 | pull-requests: write |
|
0 commit comments