Merge pull request #544 from akunzai/dependabot/npm_and_yarn/samples/… #36
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 | |
pull_request: | |
branches: | |
- main | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
permissions: read-all | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
owin-sample: | |
- 'samples/OwinSample/**' | |
react-sample-client: | |
- 'samples/AspNetCoreReactSample/ClientApp/**' | |
msbuild: | |
needs: changes | |
if: ${{ needs.changes.outputs.owin-sample == 'true' }} | |
runs-on: windows-latest | |
steps: | |
- name: Set up MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: x64 | |
- name: Build | |
run: | | |
msbuild -version | |
msbuild samples/OwinSample/OwinSample.csproj -noLogo -verbosity:minimal -restore | |
build-react-sample: | |
needs: changes | |
if: ${{ needs.changes.outputs.react-sample-client == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build | |
run: | | |
corepack enable | |
cd samples/AspNetCoreReactSample/ClientApp | |
pnpm install | |
pnpm lint | |
pnpm build | |
dotnet-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
8.0.x | |
- name: Test | |
run: | | |
dotnet test --collect:"XPlat Code Coverage" | |
dotnet tool restore | |
dotnet tool run reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:coverlet/reports" "-reporttypes:Cobertura" | |
- uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |