Skip to content

chore(agentcore-harness): correct managed memory ARN in Terraform rol… #838

chore(agentcore-harness): correct managed memory ARN in Terraform rol…

chore(agentcore-harness): correct managed memory ARN in Terraform rol… #838

Workflow file for this run

name: CI
concurrency:
group: ci-${{ github.ref }}
on:
push:
branches: [main]
workflow_dispatch:
env:
CI: "true"
NX_DAEMON: "true"
# Smithy projects resolve the Smithy CLI through mise, which reads release
# metadata from the GitHub API. Unauthenticated requests share a per-IP rate
# limit that a runner exhausts, failing the install with a 403 — so give mise
# the token every job already has.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
pull-requests: write
issues: write
statuses: write
checks: write
contents: write
actions: read
pages: write
id-token: write
jobs:
package:
name: Package
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
setup-bun: "false"
setup-terraform: "false"
- name: Package plugins
run: pnpm package:all --output-style=stream
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-artifact
path: dist
build:
name: Build
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
container-tools: "false"
setup-bun: "false"
setup-terraform: "false"
- name: Lint
run: pnpm nx run-many --target lint --all --output-style=stream
- name: Docs Unit Tests
run: pnpm nx run docs:test --output-style=stream
- name: Build docs
run: pnpm nx run docs:build --output-style=stream
- name: Check for mutations
run: git diff --ignore-space-at-eol --exit-code -- ':!**/LICENSE-THIRD-PARTY'
- name: Upload docs artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-artifact
path: docs/dist
unit_tests:
name: Unit Tests - ${{ matrix.shard }}
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
container-tools: "false"
setup-bun: "false"
setup-terraform: "false"
- name: Unit Tests (shard ${{ matrix.shard }}/10)
run: pnpm nx run @aws/nx-plugin:test --output-style=stream --shard=${{ matrix.shard }}/10
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
smoke_tests:
name: Smoke Tests - ${{matrix.smoke_test}}
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
needs: package
strategy:
fail-fast: false
matrix:
smoke_test:
- npm
- yarn-classic
- yarn-4
- pnpm-10
- pnpm-11
- bun
- create-workspace
- dungeon-adventure
- terraform
- rdb
- trpc-api
- fast-api
- smithy-api
- react-website
- infra-none
- existing-workspace
- idempotency
- cdk-deploy
- cdk-deploy-rdb
- terraform-deploy
- terraform-deploy-rdb
- license-sync
- mcp-server
- nx-plugin
- test-matrix
- local-dev
- git-secrets
- audit
- finch
- trivy
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
# local-dev (and other) smoke tests spawn many uv dev servers that
# are killed mid-run; the post-job `uv cache prune` can then hang and
# fail the job even when all tests passed. The cache buys little here.
enable-uv-cache: "false"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6
with:
role-to-assume: ${{ secrets.DEPLOY_INTEG_TESTS_ROLE_ARN }}
aws-region: us-west-2
role-duration-seconds: 10800
- name: Smoke Test - ${{ matrix.smoke_test }}
run: pnpm nx run @aws/nx-plugin-e2e:smoke-test --name=${{ matrix.smoke_test }}
# The migrate smoke test upgrades a workspace generated by each of the last few
# released versions to the local build. Every hop creates a workspace on that
# release, scaffolds the whole test matrix into it, migrates, then syncs and
# builds — so the hops are spread across machines rather than run back to back
# (NX_E2E_SHARD=<index>/<total>). Nothing here deploys, so no AWS credentials.
smoke_tests_migrate:
name: Smoke Tests - migrate (${{matrix.shard}}/5)
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
needs: package
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
enable-uv-cache: "false"
- name: Smoke Test - migrate (shard ${{ matrix.shard }}/5)
env:
NX_E2E_SHARD: ${{ matrix.shard }}/5
run: pnpm nx run @aws/nx-plugin-e2e:smoke-test --name=migrate
# The standalone smoke test generates and builds every generator, component and
# connection permutation in its own workspace. Each case's build saturates the
# machine's cores, so cases run sequentially within a shard and parallelism
# comes from sharding across machines (NX_E2E_SHARD=<index>/<total>).
smoke_tests_standalone:
name: Smoke Tests - standalone (${{matrix.shard}}/6)
runs-on: codebuild-nx-plugin-for-aws-runner-${{ github.run_id }}-${{ github.run_attempt }}
needs: package
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
enable-uv-cache: 'false'
- name: Smoke Test - standalone (shard ${{ matrix.shard }}/6)
env:
NX_E2E_SHARD: ${{ matrix.shard }}/6
run: pnpm nx run @aws/nx-plugin-e2e:smoke-test --name=standalone
smoke_tests_windows:
name: Windows Smoke Tests - ${{matrix.smoke_test}}
runs-on: windows-latest
needs: package
strategy:
fail-fast: false
matrix:
smoke_test:
- dungeon-adventure
- git-secrets
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Disable Windows Defender real-time monitoring
shell: pwsh
run: |
# Defender may not be running/ready on the runner; best-effort speed optimization.
try { Set-MpPreference -DisableRealtimeMonitoring $true } catch { }
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6
with:
role-to-assume: ${{ secrets.DEPLOY_INTEG_TESTS_ROLE_ARN }}
aws-region: us-west-2
role-duration-seconds: 10800
- name: Windows Smoke Test - ${{ matrix.smoke_test }}
run: pnpm nx run @aws/nx-plugin-e2e:smoke-test --name=${{ matrix.smoke_test }}
# Runs on CodeBuild Windows runners. NX_E2E_CODEBUILD_WINDOWS skips the cases
# that runner can't build (see standalone.spec.ts); they stay covered on the
# Linux standalone leg and the windows-latest dungeon-adventure test.
smoke_tests_windows_standalone:
name: Windows Smoke Tests - standalone (${{matrix.shard}}/6)
runs-on: codebuild-nx-plugin-for-aws-windows-runner-${{ github.run_id }}-${{ github.run_attempt }}
needs: package
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Disable Windows Defender real-time monitoring
shell: pwsh
run: |
# Not present on every Windows image; best-effort.
try { Set-MpPreference -DisableRealtimeMonitoring $true } catch { }
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
with:
# No Docker on this runner; standalone workspaces use CDK, not Terraform.
container-tools: "false"
setup-bun: "false"
setup-terraform: "false"
# Smithy projects build with the Smithy CLI, which mise cannot install
# on Windows — see .github/actions/init-monorepo.
setup-smithy: "true"
- name: Windows Smoke Test - standalone (shard ${{ matrix.shard }}/6)
env:
NX_E2E_SHARD: ${{ matrix.shard }}/6
NX_E2E_CODEBUILD_WINDOWS: "true"
run: pnpm nx run @aws/nx-plugin-e2e:smoke-test --name=standalone
release:
name: Release
needs:
[
package,
build,
unit_tests,
smoke_tests,
smoke_tests_migrate,
smoke_tests_standalone,
smoke_tests_windows,
smoke_tests_windows_standalone,
]
runs-on: ubuntu-22.04
outputs:
latest_commit: ${{ steps.git_remote.outputs.latest_commit }}
skip_release: ${{ steps.should_skip_release.outputs.skip_release }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-artifact
path: dist
- uses: ./.github/actions/init-monorepo
with:
aws-docker-login-role-arn: ${{ secrets.AWS_DOCKER_LOGIN_ROLE_ARN }}
- name: Check for new commits
id: git_remote
run: echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT
- name: Should skip release
id: should_skip_release
run: echo "skip_release=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline | grep -qE 'feat\(?.*\)?:|fix\(?.*\)?:|revert\(?.*\)?:|perf\(?.*\)?:' && echo false || echo true)" >> $GITHUB_OUTPUT
# Version, stamp migrations, tag + changelog, then publish (with retry on a
# transient failure). The whole flow lives in scripts/release.ts.
- name: Release
if: ${{ steps.should_skip_release.outputs.skip_release != 'true' && github.event_name == 'push' && steps.git_remote.outputs.latest_commit == github.sha }}
env:
# Publishing uses npm OIDC trusted publishing (no token needed).
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
HUSKY: "0"
run: pnpm exec tsx ./scripts/release.ts
deploy_docs:
name: Deploy Docs
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.release.outputs.latest_commit == github.sha }}
needs: [release]
steps:
- name: Download docs artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: docs-artifact
path: docs-site
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: "docs-site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5