Code clean up #47
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 | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**.cs' | |
- '**.csproj' | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'The reason for running a build?' | |
required: true | |
default: 'Manual build' | |
env: | |
DOTNET_VERSION: '8.0.x' # set this to the dot net version to use | |
jobs: | |
build: | |
name: build-${{matrix.os}} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@main | |
- name: 'Print manual build reason' | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
echo 'Reason: ${{ github.event.inputs.reason }}' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@main | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install dependencies | |
run: | | |
dotnet restore ./src/HaveIBeenPwned.Client.Abstractions/HaveIBeenPwned.Client.Abstractions.csproj | |
dotnet restore ./src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj | |
dotnet restore ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj | |
- name: Build | |
run: | | |
dotnet build ./src/HaveIBeenPwned.Client.Abstractions/HaveIBeenPwned.Client.Abstractions.csproj --configuration Release --no-restore | |
dotnet build ./src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj --configuration Release --no-restore | |
dotnet build ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --filter "Category!=AcceptanceTests" |