Skip to content

Run build and test with .NET 9 SDK only #4

Run build and test with .NET 9 SDK only

Run build and test with .NET 9 SDK only #4

Workflow file for this run

name: Build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet 9.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: "5.x"
preferLatestVersion: true
- name: Determine Version
id: version # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release --logger trx --results-directory "TestResults-9.0.x"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-9.0.x
path: TestResults-9.0.x
if: ${{ always() }}
- name: Package
run: dotnet pack --output pkg
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: BobTheBuilder.${{ steps.version.outputs.majorMinorPatch }}.nupkg
path: pkg/BobTheBuilder.${{ steps.version.outputs.majorMinorPatch }}.nupkg