Skip to content

Commit

Permalink
Add .NET 9.0 test project to test workflow templates
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelle committed Aug 31, 2024
1 parent bb41592 commit b40f15d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/template-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
type: string

jobs:

test:

name: ${{ inputs.openapi }}.${{ inputs.format }} (${{ inputs.version }}) ${{ inputs.os }}
Expand All @@ -24,16 +24,20 @@ jobs:
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0'

- name: 🛠️ Generate code
run: |
run: |
${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore" --output Output.cs --no-logging
${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore.Interface" --output IOutput.cs --interface-only --no-logging
${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore.UsingApiResponse" --output IApiOutput.cs --interface-only --return-api-response --no-logging
Copy-Item Output.cs ./ConsoleApp/Net6/
Copy-Item Output.cs ./ConsoleApp/Net7/
Copy-Item Output.cs ./ConsoleApp/Net8/
Copy-Item Output.cs ./ConsoleApp/Net9/
Copy-Item Output.cs ./ConsoleApp/Net48/
Copy-Item Output.cs ./ConsoleApp/Net472/
Copy-Item Output.cs ./ConsoleApp/Net462/
Expand All @@ -58,6 +62,11 @@ jobs:
run: dotnet build ./ConsoleApp/Net8/Net8.csproj
working-directory: test

- name: 🛠️ Build .NET 9 generated code
run: dotnet build ./ConsoleApp/Net9/Net9.csproj
working-directory: test
if: steps.prepare_openapi_spec.outputs.exists == 'True'

- name: 🛠️ Build .NET 4.8.1 generated code
run: dotnet build ./ConsoleApp/Net481/Net481.csproj
working-directory: test
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string

jobs:

test:

name: ${{ inputs.openapi }}.${{ inputs.format }} (${{ inputs.version }}) ${{ inputs.os }}
Expand All @@ -46,7 +46,9 @@ jobs:
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0'
- name: 🛠️ Prepare OpenAPI Spec
id: prepare_openapi_spec
run: |
Expand All @@ -67,6 +69,7 @@ jobs:
Copy-Item *.cs ./ConsoleApp/Net6/
Copy-Item *.cs ./ConsoleApp/Net7/
Copy-Item *.cs ./ConsoleApp/Net8/
Copy-Item *.cs ./ConsoleApp/Net9/
Copy-Item *.cs ./ConsoleApp/Net48/
Copy-Item *.cs ./ConsoleApp/Net472/
Copy-Item *.cs ./ConsoleApp/Net462/
Expand All @@ -76,7 +79,7 @@ jobs:
working-directory: test
shell: pwsh
if: steps.prepare_openapi_spec.outputs.exists == 'True'

- name: 🛠️ Publish generated code as Artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -99,6 +102,11 @@ jobs:
working-directory: test
if: steps.prepare_openapi_spec.outputs.exists == 'True'

- name: 🛠️ Build .NET 9 generated code
run: dotnet build ./ConsoleApp/Net9/Net9.csproj
working-directory: test
if: steps.prepare_openapi_spec.outputs.exists == 'True'

- name: 🛠️ Build .NET 4.8.1 generated code
run: dotnet build ./ConsoleApp/Net481/Net481.csproj
if: ${{ steps.prepare_openapi_spec.outputs.exists == 'True' && inputs.os == 'windows-2022' }}
Expand Down

0 comments on commit b40f15d

Please sign in to comment.