Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
royberris committed May 17, 2024
1 parent ab42ad3 commit 527a886
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,23 @@ jobs:
- name: Install openapi-diff
run: npm install -g openapi-diff

- name: NPM install
run: |
cd typespec
npm install
- name: Build .NET project and run tests
run: |
dotnet build
dotnet test
- name: Generate TypeSpec OpenAPI spec
run: |
tsp compile typespec/main.ts
tsp compile typespec/main.tsp
- name: Move generated OpenAPI spec to standard location
run: |
mv "tsp-output/@typespec/openapi3/openapi.*.yaml" openapi.yml
cp tsp-output/"@typespec"/openapi3/openapi.* openapi.yml
- name: Fetch .NET OpenAPI spec
run: |
Expand Down
2 changes: 1 addition & 1 deletion Test/OpenApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public async Task GenerateOpenApiFile()

var dotnetOpenApiSpec = await response.Content.ReadAsStringAsync();

var solutionDirectory = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\.."));
var solutionDirectory = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../.."));
var openApiFilePath = Path.Combine(solutionDirectory, "dotnet_openapi.json");

// Save the OpenAPI spec to a file for comparison
Expand Down

0 comments on commit 527a886

Please sign in to comment.