Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dotnet version #445

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 39 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
uses: actions/checkout@v4
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
# Install 6.0 for Build.fsproj
dotnet-version: 6.0.x
- name: Format Pulumi SDK
run: dotnet run format-sdk verify

Expand All @@ -48,9 +53,24 @@ jobs:
with:
submodules: recursive
- name: Setup dotnet SDK
id: setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
# Install 6.0 for Build.fsproj and the matrix version.
# `outputs.dotnet-version` is the latest version among the installed
# versions. Since Build.fsproj targets the lowest version we support,
# this works out ok for the matrix.
# https://github.com/actions/setup-dotnet?tab=readme-ov-file#dotnet-version
dotnet-version: |
6.0.x
${{ matrix.dotnet-version }}
- name: Create global.json
# This ensures that we use the matrix version instead of the runner's default version
# https://github.com/actions/setup-dotnet?tab=readme-ov-file#matrix-testing
run: |
echo '{"sdk":{"version": "${{ steps.setup-dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: Dotnet version
run: dotnet --version
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
Expand All @@ -59,6 +79,8 @@ jobs:
run: dotnet run build-sdk
- name: Workspace clean (are xml doc file updates committed?)
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: ./global.json
- name: Test Pulumi SDK
run: dotnet run test-sdk coverage
- name: Test Pulumi Automation SDK
Expand Down Expand Up @@ -97,9 +119,17 @@ jobs:
with:
submodules: recursive
- name: Setup dotnet SDK
id: setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Create global.json
# This ensures that we use the matrix version instead of the runner's default version
# https://github.com/actions/setup-dotnet?tab=readme-ov-file#matrix-testing
run: |
echo '{"sdk":{"version": "${{ steps.setup-dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: Dotnet version
run: dotnet --version
- name: Set up Go 1.22.x
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -170,9 +200,17 @@ jobs:
with:
submodules: recursive
- name: Setup dotnet SDK
id: setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Create global.json
# This ensures that we use the matrix version instead of the runner's default version
# https://github.com/actions/setup-dotnet?tab=readme-ov-file#matrix-testing
run: |
echo '{"sdk":{"version": "${{ steps.setup-dotnet.outputs.dotnet-version }}"}}' > ./global.json
- name: Dotnet version
run: dotnet --version
- name: Set up Go 1.22.x
uses: actions/setup-go@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
46 changes: 23 additions & 23 deletions integration_tests/testprovider/TestProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,40 @@ public override Task<ParameterizeResponse> Parameterize(ParameterizeRequest requ

public override Task<GetSchemaResponse> GetSchema(GetSchemaRequest request, CancellationToken ct)
{
var schema = """
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Raw strings """...""" were introduced in C# 11, however .NET 6.0 only supports up to C# 10. Convert this to use verbatim strings @"...", which unfortunately require double quoting quotes.

var schema = @"
{
"name": "NAME",
"version": "1.0.0",
"resources": {
"NAME:index:Echo": {
"description": "A test resource that echoes its input.",
"properties": {
"value": {
"$ref": "pulumi.json#/Any",
"description": "Input to echo."
""name"": ""NAME"",
""version"": ""1.0.0"",
""resources"": {
""NAME:index:Echo"": {
""description"": ""A test resource that echoes its input."",
""properties"": {
""value"": {
""$ref"": ""pulumi.json#/Any"",
""description"": ""Input to echo.""
}
},
"inputProperties": {
"value": {
"$ref": "pulumi.json#/Any",
"description": "Input to echo."
""inputProperties"": {
""value"": {
""$ref"": ""pulumi.json#/Any"",
""description"": ""Input to echo.""
}
},
"type": "object"
""type"": ""object""
}
}PARAM
}
""";
var parameterization = """
";
var parameterization = @"
,
"parameterization": {
"baseProvider": {
"name": "testprovider",
"version": "0.0.1"
""parameterization"": {
""baseProvider"": {
""name"": ""testprovider"",
""version"": ""0.0.1""
},
"parameter": "UTFBYTES"
""parameter"": ""UTFBYTES""
}
""";
";



Expand Down
3 changes: 1 addition & 2 deletions integration_tests/testprovider/TestProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<OutputType>Exe</OutputType>
<TargetFramework Condition=" '$(TARGET_FRAMEWORK)' != '' ">$(TARGET_FRAMEWORK)</TargetFramework>
<TargetFramework Condition=" '$(TARGET_FRAMEWORK)' == '' ">net6.0</TargetFramework>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading