-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/allenjzhang/typespec-server…
- Loading branch information
Showing
15 changed files
with
418 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Install Dependencies | ||
description: Setup for Dependencies | ||
|
||
inputs: | ||
node-version: | ||
required: false | ||
description: Node version for setup-node | ||
default: 20.x | ||
dotnet-version: | ||
required: false | ||
description: .NET version for setup-dotnet | ||
default: 9.x | ||
java-version: | ||
required: false | ||
description: Java version for setup-java | ||
default: 17 | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Set node version to ${{ inputs.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: npm | ||
|
||
- name: Set .NET version to ${{ inputs.dotnet-version }} | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ inputs.dotnet-version }} | ||
|
||
- name: Set Java version to ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ inputs.java-version }} | ||
distribution: microsoft | ||
cache: maven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
merge_group: | ||
workflow_dispatch: {} | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
todo-app: | ||
name: TodoApp | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Build TodoApp Asp.Net | ||
run: dotnet build | ||
working-directory: ./todoApp/servers/aspnet | ||
|
||
petstore: | ||
name: PetStore | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Build TodoApp Asp.Net | ||
run: dotnet build | ||
working-directory: ./petstore/servers/aspnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Emitter | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
merge_group: | ||
workflow_dispatch: {} | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
java: | ||
name: Java Emitter | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Generate Code | ||
run: eng/scripts/java/Generate.ps1 | ||
shell: pwsh | ||
working-directory: . | ||
|
||
- name: Verify Code Change | ||
run: git -c core.safecrlf=false diff --ignore-space-at-eol --exit-code -- ./petstore/clients/java ./todoApp/clients/java | ||
working-directory: . | ||
dotnet: | ||
name: .NET Emitter | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Generate Code | ||
run: eng/scripts/dotnet/Generate.ps1 | ||
shell: pwsh | ||
working-directory: . | ||
|
||
- name: Verify Code Change | ||
run: git -c core.safecrlf=false diff --ignore-space-at-eol --exit-code -- ./petstore/clients/dotnet ./todoApp/clients/dotnet | ||
working-directory: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Set-Location (Resolve-Path (Join-Path $PSScriptRoot '..' '..' '..')) | ||
|
||
# Make sure everything is up-to-date | ||
npm ci | ||
|
||
# Generate | ||
Remove-Item ./petstore/clients/dotnet/src/Generated -Recurse -Force | ||
Push-Location ./petstore/spec | ||
npx --no-install tsp compile . --emit "@typespec/http-client-csharp" | ||
Pop-Location | ||
|
||
Remove-Item ./todoApp/clients/dotnet/src/Generated -Recurse -Force | ||
Push-Location ./todoApp/spec | ||
npx --no-install tsp compile . --emit "@typespec/http-client-csharp" | ||
Pop-Location | ||
|
||
# Build and install SDK | ||
Push-Location ./petstore/clients/dotnet | ||
dotnet build | ||
Pop-Location | ||
|
||
Push-Location ./todoApp/clients/dotnet | ||
dotnet build | ||
Pop-Location | ||
|
||
# Build samples | ||
Push-Location ./petstore/samples/dotnet | ||
dotnet build | ||
Pop-Location | ||
|
||
Push-Location ./todoApp/samples/dotnet | ||
dotnet build | ||
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.