Skip to content

Fix items

Fix items #134

name: build and test
on:
push:
branches: [ main ]
paths-ignore:
- README.md
workflow_dispatch:
inputs:
reason:
description: The reason for running the workflow
required: true
default: Manual run
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
project:
- Blazor.SourceGenerators
- Blazor.Serialization
- Blazor.LocalStorage.WebAssembly
- Blazor.LocalStorage
- Blazor.SessionStorage.WebAssembly
- Blazor.SessionStorage
- Blazor.Geolocation.WebAssembly
- Blazor.Geolocation
- Blazor.SpeechSynthesis.WebAssembly
- Blazor.SpeechSynthesis
- Blazor.SpeechRecognition.WebAssembly
- Blazor.SpeechRecognition
steps:
- uses: actions/checkout@main
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET 7.0
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
- name: Restore dependencies for ${{ matrix.project }}
run: |
dotnet restore ./src/${{ matrix.project }}/${{ matrix.project }}.csproj
- name: Build ${{ matrix.project }}
run: |
dotnet build ./src/${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release --no-restore
test:
name: test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@main
- name: Setup .NET 7.0
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
- name: Run tests
run: |
dotnet test ./tests/Blazor.SourceGenerators.Tests/Blazor.SourceGenerators.Tests.csproj --verbosity normal
- name: Build end-to-end tests
run: |
dotnet build ./tests/Blazor.ExampleConsumer.EndToEndTests/Blazor.ExampleConsumer.EndToEndTests.csproj --configuration Release
- name: Install Playwright dependencies
run: |
pwsh ./tests/Blazor.ExampleConsumer.EndToEndTests/bin/Debug/net7.0/playwright.ps1 install --with-deps
- name: Run end-to-end tests
run: |
dotnet test ./tests/Blazor.ExampleConsumer.EndToEndTests/Blazor.ExampleConsumer.EndToEndTests.csproj --verbosity normal