From 03e8c2c2b21a44561fc440406b21513c1f51f33f Mon Sep 17 00:00:00 2001 From: Alberto Spelta Date: Fri, 2 Aug 2024 12:46:07 +0000 Subject: [PATCH] Fix dotnet SDK setup in ci.yml (#133) --- .azure/pipelines/ci.yml | 13 +++++++++---- .github/workflows/ci.yml | 30 ++++++++++++++---------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index a8315fe..8154765 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -40,15 +40,20 @@ steps: inputs: secureFile: 'VertiPaq-Analyzer.snk' - task: UseDotNet@2 - displayName: '.NET 6.0.x SDK setup' + displayName: 'Install .NET SDK' inputs: packageType: sdk - version: 6.0.x + useGlobalJson: true - task: UseDotNet@2 - displayName: '.NET 3.1.x runtime setup' + displayName: 'Install .NET 6.0 runtime' inputs: packageType: runtime - version: 3.1.x + version: '6.0.x' +- task: UseDotNet@2 + displayName: 'Install .NET 3.1 runtime' + inputs: + packageType: runtime + version: '3.1.x' - task: DotNetCoreCLI@2 displayName: '.NET restore' inputs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50d01f1..b6d95ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,5 @@ -name: CI +name: ci + on: push: branches: @@ -7,8 +8,7 @@ on: branches: - master workflow_dispatch: -env: - CONFIGURATION: 'Release' + jobs: build-and-test: name: build-and-test--${{ matrix.os-version }} @@ -18,19 +18,17 @@ jobs: os-version: [windows-latest] #, ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 - - name: .NET setup - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v4 with: - dotnet-version: | + dotnet-version: | 3.1.x 6.0.x - - name: .NET info - run: dotnet --info - - name: .NET restore - run: dotnet restore ./VertiPaq-Analyzer.slnf - - name: .NET build - run: dotnet build ./VertiPaq-Analyzer.slnf --configuration ${{ env.CONFIGURATION }} --no-restore - - name: .NET test - run: dotnet test ./VertiPaq-Analyzer.slnf --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal - - name: .NET pack - run: dotnet pack ./VertiPaq-Analyzer.slnf --configuration ${{ env.CONFIGURATION }} --no-build --no-restore --verbosity normal \ No newline at end of file + global-json-file: global.json + - name: restore + run: dotnet restore VertiPaq-Analyzer.slnf + - name: build + run: dotnet build VertiPaq-Analyzer.slnf --configuration Release --no-restore + - name: test + run: dotnet test VertiPaq-Analyzer.slnf --configuration Release --no-build --verbosity normal + - name: pack + run: dotnet pack VertiPaq-Analyzer.slnf --configuration Release --no-build --no-restore --verbosity normal \ No newline at end of file