38 lines
993 B
YAML
38 lines
993 B
YAML
name: Build and Run C# Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: '8.0.x' # Specify the .NET SDK version
|
|
|
|
- name: Check Current Directory
|
|
run: pwd # Logs the current working directory
|
|
|
|
- name: List Files
|
|
run: ls -la # Lists all files in the current directory
|
|
|
|
- name: Restore Dependencies
|
|
run: dotnet restore ./LinearAlgebra-csharp.sln # Restore NuGet packages
|
|
|
|
- name: Build the Project
|
|
run: dotnet build ./LinearAlgebra-csharp.sln --configuration Release # Build the C# project
|
|
|
|
- name: Run Unit Tests
|
|
run: dotnet test ./test/LinearAlgebra_Test.csproj --configuration Release # Execute unit tests
|