Skip to content

Commit 05938c8

Browse files
Merge branch 'develop'
2 parents 829b27c + 0a43b2c commit 05938c8

File tree

16 files changed

+201
-75
lines changed

16 files changed

+201
-75
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- "3.13"
7171
- "3.14"
7272
steps:
73-
- uses: actions/checkout@v5
73+
- uses: actions/checkout@v6
7474
- uses: actions/setup-python@v6
7575
with:
7676
python-version: ${{ matrix.python }}
@@ -101,7 +101,7 @@ jobs:
101101
- 22
102102
- 24
103103
steps:
104-
- uses: actions/checkout@v5
104+
- uses: actions/checkout@v6
105105
- uses: actions/setup-python@v6
106106
with:
107107
python-version: ${{ matrix.python }}
@@ -136,7 +136,7 @@ jobs:
136136
- 22
137137
- 24
138138
steps:
139-
- uses: actions/checkout@v5
139+
- uses: actions/checkout@v6
140140
- uses: actions/setup-python@v6
141141
with:
142142
python-version: ${{ matrix.python }}
@@ -162,7 +162,7 @@ jobs:
162162
python:
163163
- "3.13"
164164
steps:
165-
- uses: actions/checkout@v5
165+
- uses: actions/checkout@v6
166166
- uses: actions/setup-python@v6
167167
with:
168168
python-version: ${{ matrix.python }}
@@ -188,7 +188,7 @@ jobs:
188188
- "21"
189189
- "25"
190190
steps:
191-
- uses: actions/checkout@v5
191+
- uses: actions/checkout@v6
192192
- uses: actions/setup-python@v6
193193
with:
194194
python-version: ${{ matrix.python }}
@@ -217,7 +217,7 @@ jobs:
217217
- "21"
218218
- "25"
219219
steps:
220-
- uses: actions/checkout@v5
220+
- uses: actions/checkout@v6
221221
- uses: actions/setup-python@v6
222222
with:
223223
python-version: ${{ matrix.python }}
@@ -241,7 +241,7 @@ jobs:
241241
python:
242242
- "3.13"
243243
steps:
244-
- uses: actions/checkout@v5
244+
- uses: actions/checkout@v6
245245
- uses: actions/setup-python@v6
246246
with:
247247
python-version: ${{ matrix.python }}
@@ -266,7 +266,7 @@ jobs:
266266
- "3.13"
267267
- "3.14"
268268
steps:
269-
- uses: actions/checkout@v5
269+
- uses: actions/checkout@v6
270270
- uses: actions/setup-python@v6
271271
with:
272272
python-version: ${{ matrix.python }}
@@ -290,7 +290,7 @@ jobs:
290290
python:
291291
- "3.13"
292292
steps:
293-
- uses: actions/checkout@v5
293+
- uses: actions/checkout@v6
294294
- uses: actions/setup-python@v6
295295
with:
296296
python-version: ${{ matrix.python }}
@@ -301,7 +301,7 @@ jobs:
301301
- run: pytest -vv tests/integration/workflows/ruby_bundler
302302

303303
dotnet-integration:
304-
name: ${{ matrix.os }} / ${{ matrix.python }} / dotnet
304+
name: ${{ matrix.os }} / ${{ matrix.python }} / dotnet ${{ matrix.dotnet }}
305305
if: github.repository_owner == 'aws'
306306
runs-on: ${{ matrix.os }}
307307
strategy:
@@ -312,11 +312,18 @@ jobs:
312312
- windows-latest
313313
python:
314314
- "3.13"
315+
dotnet:
316+
- "6.0.x"
317+
- "8.0.x"
318+
- "10.0.x"
315319
steps:
316-
- uses: actions/checkout@v5
320+
- uses: actions/checkout@v6
317321
- uses: actions/setup-python@v6
318322
with:
319323
python-version: ${{ matrix.python }}
324+
- uses: actions/setup-dotnet@v5
325+
with:
326+
dotnet-version: ${{ matrix.dotnet }}
320327
- run: make init
321328
- run: pytest -vv tests/integration/workflows/dotnet_clipackage
322329

@@ -340,7 +347,7 @@ jobs:
340347
rust:
341348
- stable
342349
steps:
343-
- uses: actions/checkout@v5
350+
- uses: actions/checkout@v6
344351
- uses: actions/setup-python@v6
345352
with:
346353
python-version: ${{ matrix.python }}

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242

4343
steps:
4444
- name: Checkout repository
45-
uses: actions/checkout@v5
45+
uses: actions/checkout@v6
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@v3
49+
uses: github/codeql-action/init@v4
5050
with:
5151
languages: ${{ matrix.language }}
5252
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -60,7 +60,7 @@ jobs:
6060
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6161
# If this step fails, then you should remove it and run the build manually (see below)
6262
- name: Autobuild
63-
uses: github/codeql-action/autobuild@v3
63+
uses: github/codeql-action/autobuild@v4
6464

6565
# ℹ️ Command-line programs to run using the OS shell.
6666
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -73,6 +73,6 @@ jobs:
7373
# ./location_of_script_within_repo/buildscript.sh
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@v3
76+
uses: github/codeql-action/analyze@v4
7777
with:
7878
category: "/language:${{matrix.language}}"

aws_lambda_builders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# Changing version will trigger a new release!
66
# Please make the version change as the last step of your development.
77

8-
__version__ = "1.60.0"
8+
__version__ = "1.61.0"
99
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/supported_runtimes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
DOTNET_RUNTIMES = [
5353
"dotnet6",
5454
"dotnet8",
55+
"dotnet10",
5556
]
5657

5758
# Custom runtimes

aws_lambda_builders/workflows/ruby_bundler/actions.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def __init__(self, source_dir, subprocess_bundler):
2828
def execute(self):
2929
try:
3030
LOG.debug("Running bundle install in %s", self.source_dir)
31-
self.subprocess_bundler.run(["install", "--without", "development", "test"], cwd=self.source_dir)
31+
self.subprocess_bundler.run(
32+
["config", "set", "--local", "without", "development:test"], cwd=self.source_dir
33+
)
34+
self.subprocess_bundler.run(["install"], cwd=self.source_dir)
3235
except BundlerExecutionError as ex:
3336
raise ActionFailedError(str(ex))
3437

@@ -49,9 +52,8 @@ def __init__(self, source_dir, subprocess_bundler):
4952

5053
def execute(self):
5154
try:
52-
LOG.debug("Running bundle install --deployment in %s", self.source_dir)
53-
self.subprocess_bundler.run(
54-
["install", "--deployment", "--without", "development", "test"], cwd=self.source_dir
55-
)
55+
LOG.debug("Running bundle install with deployment enabled in %s", self.source_dir)
56+
self.subprocess_bundler.run(["config", "set", "--local", "deployment", "true"], cwd=self.source_dir)
57+
self.subprocess_bundler.run(["install"], cwd=self.source_dir)
5658
except BundlerExecutionError as ex:
5759
raise ActionFailedError(str(ex))

aws_lambda_builders/workflows/ruby_bundler/bundler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, osutils, bundler_exe=None):
3636
self.osutils = osutils
3737
if bundler_exe is None:
3838
if osutils.is_windows():
39-
bundler_exe = "bundler.bat"
39+
bundler_exe = "bundle.bat"
4040
else:
4141
bundler_exe = "bundle"
4242

tests/integration/workflows/dotnet_clipackage/test_dotnet.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,34 @@
1313

1414
from aws_lambda_builders.builder import LambdaBuilder
1515
from aws_lambda_builders.architecture import ARM64, X86_64
16+
from aws_lambda_builders.supported_runtimes import DOTNET_RUNTIMES
17+
18+
19+
def get_dotnet_test_params():
20+
"""Generate test parameters from DOTNET_RUNTIMES for standard Lambda functions."""
21+
params = []
22+
for runtime in DOTNET_RUNTIMES:
23+
version_num = runtime.replace("dotnet", "")
24+
version = f"{version_num}.0"
25+
test_project = f"WithDefaultsFile{version_num}"
26+
params.append((runtime, version, test_project))
27+
return params
28+
29+
30+
def get_custom_runtime_test_params():
31+
"""Generate test parameters from DOTNET_RUNTIMES for custom runtime builds.
32+
33+
Note: dotnet6 is excluded as it doesn't support custom runtime in the same way.
34+
"""
35+
params = []
36+
for runtime in DOTNET_RUNTIMES:
37+
if runtime == "dotnet6":
38+
continue
39+
version_num = runtime.replace("dotnet", "")
40+
version = f"{version_num}.0"
41+
test_project = f"CustomRuntime{version_num}"
42+
params.append((runtime, version, test_project))
43+
return params
1644

1745

1846
class TestDotnetBase(TestCase):
@@ -57,12 +85,7 @@ class TestDotnet(TestDotnetBase):
5785
def setUp(self):
5886
super(TestDotnet, self).setUp()
5987

60-
@parameterized.expand(
61-
[
62-
("dotnet6", "6.0", "WithDefaultsFile6"),
63-
("dotnet8", "8.0", "WithDefaultsFile8"),
64-
]
65-
)
88+
@parameterized.expand(get_dotnet_test_params())
6689
def test_with_defaults_file(self, runtime, version, test_project):
6790
source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
6891

@@ -83,12 +106,7 @@ def test_with_defaults_file(self, runtime, version, test_project):
83106
self.assertEqual(expected_files, output_files)
84107
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version)
85108

86-
@parameterized.expand(
87-
[
88-
("dotnet6", "6.0", "WithDefaultsFile6"),
89-
("dotnet8", "8.0", "WithDefaultsFile8"),
90-
]
91-
)
109+
@parameterized.expand(get_dotnet_test_params())
92110
def test_with_defaults_file_x86(self, runtime, version, test_project):
93111
source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
94112

@@ -109,12 +127,7 @@ def test_with_defaults_file_x86(self, runtime, version, test_project):
109127
self.assertEqual(expected_files, output_files)
110128
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version)
111129

112-
@parameterized.expand(
113-
[
114-
("dotnet6", "6.0", "WithDefaultsFile6"),
115-
("dotnet8", "8.0", "WithDefaultsFile8"),
116-
]
117-
)
130+
@parameterized.expand(get_dotnet_test_params())
118131
def test_with_defaults_file_arm64(self, runtime, version, test_project):
119132
source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
120133

@@ -135,12 +148,7 @@ def test_with_defaults_file_arm64(self, runtime, version, test_project):
135148
self.assertEqual(expected_files, output_files)
136149
self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64", version)
137150

138-
@parameterized.expand(
139-
[
140-
# ("dotnet6", "6.0", "CustomRuntime6"),
141-
("dotnet8", "8.0", "CustomRuntime8"),
142-
]
143-
)
151+
@parameterized.expand(get_custom_runtime_test_params())
144152
def test_with_custom_runtime(self, runtime, version, test_project):
145153
source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
146154

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<AWSProjectType>Lambda</AWSProjectType>
8+
<AssemblyName>bootstrap</AssemblyName>
9+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
10+
<PublishReadyToRun>true</PublishReadyToRun>
11+
</PropertyGroup>
12+
<ItemGroup>
13+
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.8.2" />
14+
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
15+
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.0" />
16+
</ItemGroup>
17+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Amazon.Lambda.Core;
2+
using Amazon.Lambda.RuntimeSupport;
3+
using Amazon.Lambda.Serialization.SystemTextJson;
4+
5+
namespace CustomRuntime10;
6+
7+
public class Function
8+
{
9+
private static async Task Main(string[] args)
10+
{
11+
Func<string, ILambdaContext, string> handler = FunctionHandler;
12+
await LambdaBootstrapBuilder.Create(handler, new DefaultLambdaJsonSerializer())
13+
.Build()
14+
.RunAsync();
15+
}
16+
17+
public static string FunctionHandler(string input, ILambdaContext context)
18+
{
19+
return input.ToUpper();
20+
}
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"Information": [
3+
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
4+
"To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
5+
"dotnet lambda help",
6+
"All the command line options for the Lambda command can be specified in this file."
7+
],
8+
"profile": "",
9+
"region": "",
10+
"configuration": "Release",
11+
"function-runtime": "provided.al2023",
12+
"function-memory-size": 256,
13+
"function-timeout": 30,
14+
"function-handler": "bootstrap",
15+
"msbuild-parameters": "--self-contained true"
16+
}

0 commit comments

Comments
 (0)