-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8afab9
commit 5cc9adf
Showing
1 changed file
with
62 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |