From cb2fff1a839178eab6803eebf6c6e0f2be3b6d90 Mon Sep 17 00:00:00 2001 From: nenoNaninu Date: Thu, 23 Nov 2023 19:59:18 +0900 Subject: [PATCH] update workflow --- .github/workflows/build-and-test.yaml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index cb4afdd..f67f68e 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -15,41 +15,51 @@ jobs: build-and-test: name: build-and-test runs-on: ubuntu-latest + strategy: + matrix: + DOTNET_VERSION: ["8.0.x", "7.0.x"] + steps: - uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ matrix.DOTNET_VERSION }} - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} + - if: matrix.DOTNET_VERSION == '7.0.x' + run: echo "DOTNET_TFM=net7.0" >> $GITHUB_ENV + + - if: matrix.DOTNET_VERSION == '8.0.x' + run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV + - name: Restore dependencies run: dotnet restore - name: Build TypedSignalR.Client.TypeScript.csproj - run: dotnet build ./src/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript.csproj --no-restore + run: dotnet build ./src/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript.csproj --framework ${{ env.DOTNET_TFM }} --no-restore - name: Build TypedSignalR.Client.TypeScript.Analyzer.csproj - run: dotnet build ./src/TypedSignalR.Client.TypeScript.Analyzer/TypedSignalR.Client.TypeScript.Analyzer.csproj --no-restore + run: dotnet build ./src/TypedSignalR.Client.TypeScript.Analyzer/TypedSignalR.Client.TypeScript.Analyzer.csproj --framework ${{ env.DOTNET_TFM }} --no-restore - name: Build TypedSignalR.Client.TypeScript.Attributes.csproj - run: dotnet build ./src/TypedSignalR.Client.TypeScript.Attributes/TypedSignalR.Client.TypeScript.Attributes.csproj --no-restore + run: dotnet build ./src/TypedSignalR.Client.TypeScript.Attributes/TypedSignalR.Client.TypeScript.Attributes.csproj --framework ${{ env.DOTNET_TFM }} --no-restore - name: Build TypedSignalR.Client.TypeScript.Generator.csproj - run: dotnet build ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --no-restore + run: dotnet build ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-restore - name: Launch test server - run: dotnet run --project ./tests/TypedSignalR.Client.TypeScript.Tests.Server/TypedSignalR.Client.TypeScript.Tests.Server.csproj --no-restore & + run: dotnet run --project ./tests/TypedSignalR.Client.TypeScript.Tests.Server/TypedSignalR.Client.TypeScript.Tests.Server.csproj --framework ${{ env.DOTNET_TFM }} --no-restore & - name: Generate TypeScript code for test (JSON) - run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework net8.0 --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/json + run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/json - name: Generate TypeScript code for test (MessagePack) - run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework net8.0 --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/msgpack --serializer MessagePack --naming-style none + run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/msgpack --serializer MessagePack --naming-style none - name: Install yarn run: npm install -g yarn