From 527a886c48d7ab3389835f0c1e44a359688fbe3f Mon Sep 17 00:00:00 2001 From: Roy Berris Date: Fri, 17 May 2024 20:49:37 +0200 Subject: [PATCH] update workflow --- .github/workflows/main.yml | 9 +++++++-- Test/OpenApiTest.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c2e896..b465840 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,11 @@ 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 @@ -36,11 +41,11 @@ jobs: - 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: | diff --git a/Test/OpenApiTest.cs b/Test/OpenApiTest.cs index 0d7d395..f2ca320 100644 --- a/Test/OpenApiTest.cs +++ b/Test/OpenApiTest.cs @@ -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