Skip to content

r/aws_bedrockagentcore_agent_runtime: add metadata_configuration argument #35513

r/aws_bedrockagentcore_agent_runtime: add metadata_configuration argument

r/aws_bedrockagentcore_agent_runtime: add metadata_configuration argument #35513

Workflow file for this run

# Copyright IBM Corp. 2014, 2026
# "SPDX-License-Identifier: MPL-2.0"
name: Provider Checks
on:
push:
branches:
- main
- "release/**"
pull_request:
paths:
- .github/workflows/provider.yml
- .ci/.golangci.yml
- .ci/tools/go.mod
- .markdownlint.yml
- internal/**
- docs/index.md
- docs/data-sources/**
- docs/guides/**
- docs/resources/**
- go.sum
- GNUmakefile
- main.go
- names/**
- website/**
- '**/*.tf'
- '**/*.tfvars'
- '**/*.tftest.hcl'
- '**/*.tfquery.hcl'
## NOTE: !!!
## When changing these workflows, ensure that the following is updated:
## - Documentation: docs/continuous-integration.md
## - Documentation: docs/makefile-cheat-sheet.md
## - Makefile: ./GNUmakefile
env:
AWS_DEFAULT_REGION: us-west-2
TERRAFORM_VERSION: "1.8.3"
permissions:
contents: read # required for checkout
jobs:
go_mod_download:
name: go mod download
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
id: cache-go-pkg-mod
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- if: steps.cache-go-pkg-mod.outputs.cache-hit != 'true' || steps.cache-go-pkg-mod.outcome == 'failure'
run: go mod download
go_build:
name: go build
needs: [go_mod_download]
runs-on: custom-ubuntu-22.04-large
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
# Restore build cache with daily rotation to prevent unbounded growth
# Falls back to yesterday's cache if today's doesn't exist
- name: Restore Go Build Cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache-go-build
continue-on-error: true
timeout-minutes: 3
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ hashFiles('go.sum') }}-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-${{ hashFiles('go.sum') }}-
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- name: go build
run: make go-build
# Aggressively clean cache before saving to prevent extraction failures
# Large caches (>5GB) can fail silently during tar extraction
- name: Cleanup Build Cache Before Save
if: always()
run: |
if [ -d "$GOCACHE" ]; then
echo "Cache size before cleanup:"
du -sh $GOCACHE
# Remove test binaries
find $GOCACHE -name "*.test" -type f -delete 2>/dev/null || true
# Remove entries older than 1 day
find $GOCACHE -type f -mtime +1 -delete 2>/dev/null || true
find $GOCACHE -type d -empty -delete 2>/dev/null || true
echo "Cache size after cleanup:"
du -sh $GOCACHE
fi
# Save build cache for reuse by go_test and future runs
- name: Save Go Build Cache
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: always() && steps.cache-go-build.outputs.cache-hit != 'true'
continue-on-error: true
timeout-minutes: 5
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
go_generate:
name: go generate
needs: [go_build]
runs-on: custom-ubuntu-22.04-medium
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
# Reuse build cache from go_build
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ hashFiles('go.sum') }}-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-${{ hashFiles('go.sum') }}-
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: go install golang.org/x/tools/cmd/goimports@latest
- run: go install golang.org/x/tools/cmd/stringer@latest
- run: GO_VER=go make gen-raw
- name: Check for Git Differences
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make gen' command and commit."; exit 1)
terraform_fmt:
name: terraform fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
- run: make terraform-fmt
- name: Check for Git Differences
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after terraform formatting. Run 'make terraform-fmt' command and commit."; exit 1)
go_test:
name: go test (shard ${{ matrix.shard }})
needs: [go_build]
runs-on: custom-ubuntu-22.04-xl
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
total-shards: [4]
env:
GOMAXPROCS: 8
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
# Reuse build cache from go_build job to avoid recompilation
# This is the key optimization - tests reuse production build artifacts
- name: Restore Go Build Cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache-go-build
continue-on-error: true
timeout-minutes: 3
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- name: Go Test Shard ${{ matrix.shard }}
run: make test-shard SHARD=${{ matrix.shard }} TOTAL_SHARDS=${{ matrix.total-shards }}
# Only shard 0 needs cleanup since it's the only one that saves cache
- name: Cleanup Test Artifacts
if: always() && matrix.shard == 0
run: |
if [ -d "$GOCACHE" ]; then
echo "Cache size before cleanup:"
du -sh $GOCACHE
# Remove test binaries (*.test files) - they're huge and rarely reused
find $GOCACHE -name "*.test" -type f -delete 2>/dev/null || true
# Remove entries older than 1 day
find $GOCACHE -type f -mtime +1 -delete 2>/dev/null || true
find $GOCACHE -type d -empty -delete 2>/dev/null || true
echo "Cache size after cleanup:"
du -sh $GOCACHE
fi
# Save updated cache with test compilation (but cleaned)
# Only shard 0 saves to avoid race conditions
- name: Save Go Build Cache
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: always() && matrix.shard == 0 && steps.cache-go-build.outputs.cache-hit != 'true'
continue-on-error: true
timeout-minutes: 5
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
import-lint:
needs: [go_build]
runs-on: custom-ubuntu-22.04-medium
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/tools && go install github.com/pavius/impi/cmd/impi
- run: impi --local . --scheme stdThirdPartyLocal ./...
# validate_sweepers_unlinked checks that the sweeper functions are not linked in the provider binary.
# As a pre-check, to validate that the check will work, it confirms that `strings` will find the function
# names in the compiled sweeper binary.
validate_sweepers_unlinked:
name: Sweeper Functions Not Linked
needs: [go_build]
runs-on: custom-ubuntu-22.04-medium
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- name: Pre-Check sweeper binary
run: |
go test -c -o ./sweeper-bin ./internal/sweep/
count=$(strings ./sweeper-bin | \
grep --count --extended-regexp 'internal/service/[a-zA-Z0-9]+\.sweep[a-zA-Z0-9]+$')
[ $count -gt 0 ] || \
(echo; echo "Expected `strings` to detect sweeper function names in sweeper binary."; exit 1)
# Use cached provider or rebuild
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
continue-on-error: true
id: cache-terraform-plugin-dir
timeout-minutes: 2
with:
path: terraform-plugin-dir
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }}
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
name: go build
run: go build -o terraform-plugin-dir/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-aws .
- name: Check provider binary
run: |
# grep returns the exit code 1 if there are no results. Disable immediate exit.
set +e
count=$(strings "terraform-plugin-dir/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-aws" | \
grep --count --extended-regexp 'internal/service/[a-zA-Z0-9]+\.sweep[a-zA-Z0-9]+$')
set -e
[ $count -eq 0 ] || \
(echo; echo "Expected `strings` to detect no sweeper function names in provider binary."; exit 1)
cache-info:
runs-on: custom-ubuntu-22.04-medium
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-
- name: Local Cache Info
run: make cache-info
- name: GitHub Actions Cache List
env:
GH_TOKEN: ${{ github.token }}
run: |
echo ""
echo "=== GitHub Actions Cache Entries ==="
gh cache list --limit 100 --json key,ref,sizeInBytes,createdAt,lastAccessedAt | \
jq -r '.[] | "\(.key) | \(.ref) | \(.sizeInBytes / 1024 / 1024 | floor)MB | Created: \(.createdAt) | Accessed: \(.lastAccessedAt)"' | \
column -t -s '|' || echo "Failed to list caches"
echo ""
echo "=== Cache Usage Summary ==="
gh cache list --limit 100 --json sizeInBytes | \
jq '[.[].sizeInBytes] | add / 1024 / 1024 / 1024 | "Total cache size: \(. | floor)GB"' -r || echo "Failed to calculate total"
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
with:
args: "."
ignore: "./.agents ./docs ./website/docs ./AGENTS.md ./CHANGELOG.md ./internal/service/cloudformation/test-fixtures/examplecompany-exampleservice-exampleresource/docs"
misspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/tools && go install github.com/client9/misspell/cmd/misspell
- run: make go-misspell