E2E Test Coverage Part 2 #673
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: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
MINVERBUILDMETADATA: build.${{ github.run_number }} | |
jobs: | |
build: | |
name: pipeline-${{ matrix.os }}-dotnet-${{ matrix.dotnet-version }} | |
runs-on: ${{ matrix.os }} | |
services: | |
hivemq: | |
image: hivemq/hivemq4:latest | |
ports: | |
- 1883:1883 | |
- 8000:8000 | |
- 8080:8080 | |
options: >- | |
--health-cmd "curl -I http://localhost:8080/" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
--health-start-period 30s | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
dotnet-version: ['6.0.x', '7.0.x', '8.0.x', '9.0.x'] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- name: Install .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '${{ matrix.dotnet-version }}' | |
- name: List Installed SDKs | |
run: dotnet --list-sdks | |
- name: Create temporary global.json | |
run: echo '{"sdk":{"version":"${{ matrix.dotnet-version }}"}}' > global.json | |
- name: Dotnet Tool Restore | |
run: dotnet tool restore | |
shell: pwsh | |
- name: Dotnet Cake Build | |
run: dotnet cake --target=Build | |
shell: pwsh | |
- name: Dotnet Cake Test | |
run: dotnet cake --target=Test | |
shell: pwsh | |
- name: Dotnet Cake Pack | |
run: dotnet cake --target=Pack | |
shell: pwsh | |
- name: Upload NuGet packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages-${{ matrix.dotnet-version }} | |
path: ./Artifacts/*.nupkg | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download NuGet packages for .NET 6.0 | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages-6.0.x | |
path: ./Artifacts | |
- name: Download NuGet packages for .NET 7.0 | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages-7.0.x | |
path: ./Artifacts | |
- name: Download NuGet packages for .NET 8.0 | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages-8.0.x | |
path: ./Artifacts | |
- name: Download NuGet packages for .NET 9.0 | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages-9.0.x | |
path: ./Artifacts | |
- name: Push to NuGet | |
if: github.event_name == 'release' | |
run: dotnet nuget push ./Artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
shell: pwsh |