Add Actions #8
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: .NET 8.0 | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-24.04, windows-2022] | |
configuration: [Debug, Release] | |
env: | |
SOLUTION_NAME: GameServer.sln | |
TEST_PROJECT_PATH: GameServerConsole/GameServerConsole.csproj | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Build solution | |
run: dotnet build ${{ env.SOLUTION_NAME }} --configuration ${{ matrix.configuration }} | |
- name: Run unit tests | |
run: dotnet test ${{ env.TEST_PROJECT_PATH }} --configuration ${{ matrix.configuration }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Build_Artifacts | |
path: '**/bin/${{ matrix.configuration }}/net8.0' |