Skip to content

Commit

Permalink
chore(ci): add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi authored Oct 21, 2024
1 parent fc7ae6e commit 531d77e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

# Restore dependencies for the main project
- name: Restore dependencies for PDNDClientAssertionGenerator
run: dotnet restore src/PDNDClientAssertionGenerator/PDNDClientAssertionGenerator.csproj

# Restore dependencies for the test project
- name: Restore dependencies for PDNDClientAssertionGenerator.Tests
run: dotnet restore src/PDNDClientAssertionGenerator.Tests/PDNDClientAssertionGenerator.Tests.csproj

# Build the main project
- name: Build PDNDClientAssertionGenerator
run: dotnet build src/PDNDClientAssertionGenerator/PDNDClientAssertionGenerator.csproj --no-restore --configuration Release

# Build the test project
- name: Build PDNDClientAssertionGenerator.Tests
run: dotnet build src/PDNDClientAssertionGenerator.Tests/PDNDClientAssertionGenerator.Tests.csproj --no-restore --configuration Release

# Run the tests
- name: Run tests
run: dotnet test src/PDNDClientAssertionGenerator.Tests/PDNDClientAssertionGenerator.Tests.csproj --no-build --verbosity normal
continue-on-error: true # Optional: allows workflow to continue even if tests fail, but mark the job as failed

0 comments on commit 531d77e

Please sign in to comment.