RabbitMQ Publisher #10
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: Events PR Build | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
dotnet-version: [6.0.x, 7.0.x, 8.0.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set the TFM in Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
VERSION=$(echo "${{ matrix.dotnet-version }}" | sed 's/[^0-9.]*//g') | |
VERSION=$(echo "${VERSION}" | sed 's/\.$//') | |
DOTNET_TFM="net${VERSION}" | |
echo "DOTNET_TFM=$DOTNET_TFM" >> $GITHUB_ENV | |
- name: Set the TFM in Windows | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
$VERSION = "${{ matrix.dotnet-version }}".Substring(0, "${{ matrix.dotnet-version }}".LastIndexOf('.')) | |
$DOTNET_TFM = "net$VERSION" | |
echo "DOTNET_TFM=$DOTNET_TFM" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Setup .NET ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore -f ${{ env.DOTNET_TFM }} | |
- name: Test (Ubuntu)) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: dotnet test -c Release --no-build --verbosity normal --framework ${{ env.DOTNET_TFM }} | |
- name: Test (Windows) | |
if: startsWith(matrix.os, 'windows') | |
run: dotnet test -c Release --no-build --verbosity normal --framework ${{ env.DOTNET_TFM }} --filter Channel!=RabbitMQ | |