ci: Create dotnet-ci.yml (#6) #6
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
name: Build server | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
# For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
runs-on: ${{ matrix.os }} | |
env: | |
Solution_Name: dotnet-bsp.sln | |
Test_Project_Path: test/bsp-server.tests.csproj | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
9.0.x | |
- name: Restore the application | |
run: dotnet restore --locked-mode ${{ env.Solution_Name }} | |
- name: Build | |
run: dotnet build --no-restore ${{ env.Solution_Name }} | |
- name: Execute unit tests | |
run: dotnet test --no-build ${{ env.Solution_Name }} |