Skip to content

test

test #149

Workflow file for this run

name: Build & Test
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
NET6: net6.0
NET7: net7.0
NET8: net8.0
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dotnet-version: [ '6.0.x', '7.0.x', '8.0.x' ]
runs-on: ${{ matrix.os }}
env:
NET_VERSION: net${{ matrix.dotnet-version }}
steps:
- uses: actions/checkout@v4
- name: Set .NET version variable
run: |
if [[ "${{ matrix.dotnet-version }}" == '6.0.x' ]]; then
NET_VERSION=NET6
else if [[ "${{ matrix.dotnet-version }}" == '7.0.x' ]]; then
NET_VERSION=NET7
else
NET_VERSION=NET8
fi
echo "NET_VERSION=$NET_VERSION" >> $GITHUB_ENV
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test -f ${{ env.NET_VERSION }} --no-restore --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.os }} ${{ matrix.dotnet-version }}"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: ${{ matrix.os }} ${{ matrix.dotnet-version }}
path: |
TestResults-${{ matrix.os }} ${{ matrix.dotnet-version }}
ArtNetSharp/bin/Release/**/ArtNetSharp.dll
retention-days: 2
continue-on-error: true