Skip to content

Commit

Permalink
Merge pull request #752 from aws-powertools/develop
Browse files Browse the repository at this point in the history
chore: Sync main with develop for release 1.20
  • Loading branch information
hjgraca authored Feb 10, 2025
2 parents 6e3eee5 + 6deceb3 commit ec874c0
Show file tree
Hide file tree
Showing 81 changed files with 2,362 additions and 404 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup .NET 6.0 & 8.0
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
with:
dotnet-version: |
6.0.405
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 #v2
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 #v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 #v2
uses: github/codeql-action/autobuild@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 #v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -52,4 +52,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 #v2
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 #v2
2 changes: 1 addition & 1 deletion .github/workflows/dispatch_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
environment: analytics
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9
with:
aws-region: eu-central-1
role-to-assume: ${{ secrets.AWS_ANALYTICS_ROLE_ARN }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.12"
- name: Capture branch and tag
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Build docs website
run: make build-docs-website
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
Expand All @@ -54,18 +54,18 @@ jobs:
environment: Docs
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0
- name: Setup .NET 8.0
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
with:
dotnet-version: 6.0.405
dotnet-version: '8.x'

- name: Build Api Docs
run: |
dotnet tool install -g docfx
docfx apidocs/docfx.json
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
Expand Down
44 changes: 24 additions & 20 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PROCESS
#
# 1. Deploy the core and AOT stacks using the infra deployment workflow.
# 1. Deploy the E2E stacks using the infra deployment workflow for non-aot and aot.
# 2. Run the E2E tests after the infrastructure is deployed.
# 3. Destroy the CDK stacks after the tests are completed.

Expand Down Expand Up @@ -33,14 +33,14 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true

- name: Set up .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
with:
dotnet-version: '8.x'

Expand All @@ -50,10 +50,10 @@ jobs:
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools

- name: Deploy Core Stack
- name: Deploy Stack
run: |
cd libraries/tests/e2e/infra
cdk deploy --require-approval never
cdk deploy --all --require-approval never
deploy-aot-stack:
strategy:
Expand All @@ -70,14 +70,14 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true

- name: Set up .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
with:
dotnet-version: '8.x'

Expand All @@ -90,35 +90,39 @@ jobs:
- name: Deploy AOT Stack
run: |
cd libraries/tests/e2e/infra-aot
cdk deploy -c architecture=${{ matrix.arch }} --require-approval never
cdk deploy --all -c architecture=${{ matrix.arch }} --require-approval never
run-tests:
strategy:
matrix:
utility: [core, idempotency]
runs-on: ubuntu-latest
needs: [deploy-stack,deploy-aot-stack]

steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true

- name: Set up .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
with:
dotnet-version: '8.x'

- name: Run Core Tests
- name: Run Tests
run: |
cd libraries/tests/e2e/functions/core
cd libraries/tests/e2e/functions/${{ matrix.utility }}
dotnet test --filter Category!=AOT
- name: Run Core AOT Tests
- name: Run AOT Tests
run: |
cd libraries/tests/e2e/functions/core
cd libraries/tests/e2e/functions/${{ matrix.utility }}
dotnet test --filter Category=AOT
destroy-stack:
Expand All @@ -130,7 +134,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
Expand All @@ -142,10 +146,10 @@ jobs:
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools

- name: Destroy Core Stack
- name: Destroy Stack
run: |
cd libraries/tests/e2e/infra
cdk destroy --force
cdk destroy --all --force
destroy-aot-stack:
strategy:
Expand All @@ -164,7 +168,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
Expand All @@ -176,8 +180,8 @@ jobs:
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools

- name: Destroy arm64 AOT Core Stack
- name: Destroy arm64 AOT Stack
run: |
cd libraries/tests/e2e/infra-aot
cdk destroy -c architecture=${{ matrix.arch }} --force
cdk destroy --all -c architecture=${{ matrix.arch }} --force
48 changes: 48 additions & 0 deletions .github/workflows/ossf_scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
schedule:
- cron: "0 9 * * *"
push:
branches: [main]
workflow_dispatch:

permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# environment: scorecard
permissions:
security-events: write # update code-scanning dashboard
id-token: write # confirm org+repo identity before publish results

steps:
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true # publish to OSSF Scorecard REST API
# repo_token: ${{ secrets.SCORECARD_TOKEN }} # read-only fine-grained token to read branch protection settings

- name: "Upload results"
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions .github/workflows/reusable_publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.12"
cache: "poetry"
Expand All @@ -67,7 +67,7 @@ jobs:
poetry run mike set-default --push latest
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
brew install -f docfx --skip-cask-deps --ignore-dependencies
docfx apidocs/docfx.json
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/secure_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Ensure 3rd party workflows have SHA pinned
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@c3a2b64f69b7a1542a68f44d9edbd9ec3fc1455e # v3.0.20
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@6eb1abde32fed00453b0d03497f4ba4fecba146d # v3.0.21
with:
# Trusted GitHub Actions and/or organizations
allowlist: |
Expand Down
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# v9.1.18
FROM squidfunk/mkdocs-material@sha256:41942f7a2f5163aacd0e866e076d95db4f26550b97d76c1594c04250cbb580e9
FROM squidfunk/mkdocs-material@sha256:c62453b1ba229982c6325a71165c1a3007c11bd3dd470e7a1446c5783bd145b4
RUN pip install mkdocs-git-revision-date-plugin
Loading

0 comments on commit ec874c0

Please sign in to comment.