.NET #2
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
# # This workflow will build and test a .NET project. | |
# # Web server is in the folder backend. | |
# # Tests are in the folder testBackend | |
# name: .NET | |
# on: | |
# push: | |
# branches: ["suyash-test" ] | |
# paths-ignore: | |
# - README.md | |
# - .vscode/** | |
# - .gitignore | |
# pull_request: | |
# branches: ["suyash-test"] | |
# paths-ignore: | |
# - README.md | |
# - .vscode/** | |
# - .gitignore | |
# workflow_dispatch: | |
# jobs: | |
# build-and-test: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Setup .NET | |
# uses: actions/setup-dotnet@v4 | |
# with: | |
# dotnet-version: 8.x | |
# - name: cache dependencies | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.backend/WebServer | |
# ~/.testBackend | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
# - name: Restore dependencies | |
# run: | | |
# cd ./backend/WebServer | |
# dotnet restore --locked-mode | |
# cd ../../testBackend | |
# dotnet restore --locked-mode | |
# - name: Build | |
# working-directory: ./backend/WebServer | |
# run: dotnet build --no-restore | |
# - name: Test | |
# working-directory: ./testBackend | |
# run: dotnet test --verbosity normal | |
# Web server is in the folder backend. | |
# Tests are in the folder testBackend | |
name: .NET | |
on: workflow_dispatch | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
cache: true | |
cache-dependency-path: | | |
./backend/packages.lock.json | |
./testBackend/packages.lock.json | |
- name: Restore dependencies | |
run: | | |
cd ./backend/WebServer | |
dotnet restore --locked-mode | |
cd ../../testBackend | |
dotnet restore --locked-mode | |
- name: Build | |
working-directory: ./backend/WebServer | |
run: dotnet build --no-restore | |
- name: Test | |
working-directory: ./testBackend | |
run: dotnet test --verbosity normal |