From 82481f3029d78024274c5a178c3e630c591aeea9 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 17 Jul 2024 10:52:21 +0100 Subject: [PATCH] Update build CI to use modern dotnet tooling --- .github/workflows/ci-audit.yml | 46 ++++++++++++++++++++-------------- Directory.Build.props | 1 - 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci-audit.yml b/.github/workflows/ci-audit.yml index cf6d2ed..ec61c9e 100644 --- a/.github/workflows/ci-audit.yml +++ b/.github/workflows/ci-audit.yml @@ -2,32 +2,40 @@ name: CI-Audit on: push: - branches: [ main ] + # This prevents tag pushes from triggering this workflow + branches: ['*'] pull_request: - branches: [ main ] workflow_dispatch: - +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false + ContinuousIntegrationBuild: true jobs: audit: - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + configuration: [debug, release] + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.3.4 - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1 + uses: actions/checkout@v4 - - name: Setup VSTest - uses: darenm/Setup-VSTest@v1 - - - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.5 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x - - name: Restore NuGet Packages - run: nuget restore src/Aeon.sln + - name: Restore + run: dotnet restore - - name: Build Project - run: msbuild src/Aeon.sln /p:Configuration=Release + - name: Build + run: dotnet build --no-restore --configuration ${{ matrix.configuration }} + + - name: Pack + run: dotnet pack --no-restore --no-build --configuration ${{ matrix.configuration }} - - name: Run Tests - run: vstest.console.exe src/Aeon.Tests/bin/Release/net472/Aeon.Tests.dll \ No newline at end of file + - name: Test + run: dotnet test --no-restore --no-build --configuration ${{ matrix.configuration }} \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index e23b04b..41ae192 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,6 @@ Copyright © 2023-2024 University College London https://sainsburywellcomecentre.github.io/aeon_docs https://github.com/SainsburyWellcomeCentre/aeon_acquisition.git - true snupkg LICENSE true