#240 add papercut smtp hosting #917
Workflow file for this run
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 CI | |
on: | |
pull_request: | |
branches: ["*"] | |
paths: | |
- "src/**" | |
- "examples/**" | |
- "tests/**" | |
- Directory.Build.props | |
- Directory.Build.targets | |
- Directory.Packages.props | |
- ".github/workflows/**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
fail-fast: false | |
runs-on: "${{ matrix.os }}" | |
env: | |
DOTNET_CONFIGURATION: Release | |
DAPR_VERSION: "1.14.1" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Runtimes, Caching, and Tools | |
uses: ./.github/actions/setup-runtimes-caching | |
with: | |
hash-file: ".github/workflows/dotnet-ci.yml" | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }} | |
- name: Test | |
run: dotnet test --no-build --configuration ${{ env.DOTNET_CONFIGURATION }} --collect "XPlat Code Coverage" --results-directory test-results --logger trx /p:TrxLogFileNameSuffix=${{ matrix.os }} | |
- name: Publish NuGet package | |
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ./nuget -p:VersionSuffix='alpha.${{ github.run_number }}' | |
- name: Publish NuGet packages as artifacts | |
if: ${{ matrix.os == 'ubuntu-latest' && github.actor != 'dependabot[bot]' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages | |
path: ./nuget | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results-${{ matrix.os }} | |
path: | | |
${{ github.workspace }}/test-results/** | |
- name: List NuGet packages in step summary | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: ls -1 ${{ github.workspace }}/nuget/*.nupkg >> $GITHUB_STEP_SUMMARY | |
publish-azure-artifacts: | |
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository | |
needs: build | |
runs-on: windows-latest | |
environment: | |
name: azure-artifacts | |
steps: | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages | |
- name: Add AzDO NuGet feed | |
run: > | |
dotnet nuget add source | |
https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json | |
--name PullRequests | |
--username dummy | |
--password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }} | |
- name: Push signed packages to AzDO | |
run: > | |
dotnet nuget push | |
"${{ github.workspace }}/**/*.nupkg" | |
--api-key dummy | |
--source PullRequests | |
--skip-duplicate | |
publish-coverage: | |
if: github.actor != 'dependabot[bot]' | |
needs: build | |
uses: ./.github/workflows/code-coverage.yml | |
secrets: inherit |