Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DemurestPie authored Nov 26, 2024
1 parent e8afab9 commit 5cc9adf
Showing 1 changed file with 62 additions and 25 deletions.
87 changes: 62 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,77 @@
name: CSCI2910_Lab5
name: .NET Core Console CI



on:

push:
branches:
- main

branches: [ "main" ]

pull_request:
branches:
- main

branches: [ "main" ]



jobs:

build-and-test:
runs-on: windows-latest



name: build-and-test-${{matrix.os}}

runs-on: ${{ matrix.os }}

strategy:

matrix:

os: [ubuntu-latest, windows-latest, macOS-latest]



env:

Solution_Name: TestCases.sln

Test_Project_Path: TestProject1/TestProject1.csproj



steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Checkout repository

uses: actions/checkout@v4



- name: Install .NET Core

uses: actions/setup-dotnet@v4

with:
dotnet-version: '8.0.x'

# Restore dependencies
- name: Restore dependencies
run: dotnet restore
dotnet-version: '8.0.x'



- name: Restore NuGet packages

run: dotnet restore ${{ env.Solution_Name }}



- name: Build solution

run: dotnet build ${{ env.Solution_Name }} --configuration Release --no-restore



# Build the solution
- name: Build the solution
run: dotnet build --no-restore --configuration Release
- name: Test and publish results

# Run MSTest
- name: Run tests
run: dotnet test --no-build --verbosity normal
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
run: |
dotnet test ${{ env.Test_Project_Path }} --no-restore --verbosity normal

0 comments on commit 5cc9adf

Please sign in to comment.