Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ updates:
schedule:
interval: "weekly"

- package-ecosystem: "npm"
directory: "/cdk"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/cdk"
schedule:
interval: "weekly"
56 changes: 54 additions & 2 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,60 @@ jobs:
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Wait for tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-tests
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: unit-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30

- name: Wait for integration tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-integration
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: integration-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30

- name: Wait for LocalStack tests to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-localstack
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: localstack-test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 30

- name: Enable auto-merge for Dependabot PRs
if: |
steps.wait-for-tests.outputs.conclusion == 'success' &&
steps.wait-for-integration.outputs.conclusion == 'success' &&
steps.wait-for-localstack.outputs.conclusion == 'success'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR if tests failed
if: |
steps.wait-for-tests.outputs.conclusion != 'success' ||
steps.wait-for-integration.outputs.conclusion != 'success' ||
steps.wait-for-localstack.outputs.conclusion != 'success'
run: |
gh pr comment "$PR_URL" --body "🚫 Auto-merge skipped: one or more test jobs failed or timed out.

- unit-test: ${{ steps.wait-for-tests.outputs.conclusion }}
- integration-test: ${{ steps.wait-for-integration.outputs.conclusion }}
- localstack-test: ${{ steps.wait-for-localstack.outputs.conclusion }}

Please review the failing checks and resolve any issues."
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 8 additions & 5 deletions .github/workflows/test-appsync-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ on:
workflow_dispatch:

env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:18
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:22
NODE_VERSION: 22
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK if this works, but...

Suggested change
TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:22
NODE_VERSION: 22
NODE_VERSION: 22
TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:${NODE_VERSION}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty telling... 😂

image


jobs:
unit-test:
Expand All @@ -20,7 +21,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm test

Expand All @@ -30,7 +31,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}

- name: Pull test docker image
run: docker pull $TEST_IMAGE_NAME
Expand All @@ -51,13 +52,15 @@ jobs:
image-tag: "latest"
use-pro: "true"
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }}
LOCALSTACK_AUTH_TOKEN: ${{ env.LOCALSTACK_AUTH_TOKEN }}
APPSYNC_JS_LIBS_VERSION: ${{ github.sha }}
DEBUG: "1"
DISABLE_EVENTS: "1"
- name: Ensure pro image is used
run: curl -s http://localhost:4566/_localstack/health | grep appsync
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Execute test script
run: bash .github/execute-localstack-test.sh
- name: Get the LocalStack logs
Expand Down