Skip to content

V5.0.8/service update #39

V5.0.8/service update

V5.0.8/service update #39

Workflow file for this run

name: Savvy I/O CI Pipeline
on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
configuration:
type: choice
description: The build configuration to use in the deploy stage.
required: true
default: Release
options:
- Debug
- Release
run_mac_tests:
type: boolean
description: Run the macOS test matrix despite the additional cost and runtime.
default: false
permissions:
contents: read
jobs:
init:
name: initialize
runs-on: ubuntu-24.04
outputs:
run-mac-tests: ${{ steps.vars.outputs.run-mac-tests }}
run-privileged-jobs: ${{ steps.vars.outputs.run-privileged-jobs }}
strong-name-key-filename: ${{ steps.vars.outputs.strong-name-key-filename }}
build-switches: ${{ steps.vars.outputs.build-switches }}
steps:
- id: vars
name: calculate workflow variables
shell: bash
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.run_mac_tests }}" == "true" ]]; then
echo "run-mac-tests=true" >> "$GITHUB_OUTPUT"
else
echo "run-mac-tests=false" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
echo "run-privileged-jobs=false" >> "$GITHUB_OUTPUT"
echo "strong-name-key-filename=" >> "$GITHUB_OUTPUT"
echo "build-switches=-p:SkipSignAssembly=true" >> "$GITHUB_OUTPUT"
else
echo "run-privileged-jobs=true" >> "$GITHUB_OUTPUT"
echo "strong-name-key-filename=savvyio.snk" >> "$GITHUB_OUTPUT"
echo "build-switches=" >> "$GITHUB_OUTPUT"
fi
prepare_test:
name: 📜 Prepare Test
runs-on: ubuntu-24.04
outputs:
json: ${{ steps.test-projects.outputs.result }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- id: test-projects
name: Generate matrix for test projects
uses: codebeltnet/shell-globbing@v2
with:
pattern: |
test/**/*.csproj
!test/**/Savvyio.FunctionalTests.csproj
!test/**/Savvyio.Extensions.SimpleQueueService.FunctionalTests.csproj
!test/**/Savvyio.Extensions.QueueStorage.FunctionalTests.csproj
!test/**/Savvyio.Extensions.NATS.FunctionalTests.csproj
!test/**/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj
- name: JSON output
run: echo "${{ steps.test-projects.outputs.result }}"
build:
name: call-build
needs: [init]
strategy:
matrix:
arch: [X64, ARM64]
configuration: [Debug, Release]
uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v3
with:
runs-on: ${{ matrix.arch == 'ARM64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
configuration: ${{ matrix.configuration }}
strong-name-key-filename: ${{ needs.init.outputs.strong-name-key-filename }}
build-switches: ${{ needs.init.outputs.build-switches }}
upload-build-artifact-name: build-${{ matrix.configuration }}-${{ matrix.arch }}
secrets: inherit
pack:
name: call-pack
needs: [build]
strategy:
matrix:
configuration: [Debug, Release]
uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v3
with:
configuration: ${{ matrix.configuration }}
version: ${{ needs.build.outputs.version }}
download-build-artifact-pattern: build-${{ matrix.configuration }}-X64
test_linux:
name: call-test-linux
needs: [build, prepare_test]
strategy:
fail-fast: false
matrix:
arch: [X64, ARM64]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: ${{ matrix.arch == 'ARM64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
download-pattern: build-${{ matrix.configuration }}-${{ matrix.arch }}
test_windows:
name: call-test-windows
needs: [build, prepare_test]
strategy:
fail-fast: false
matrix:
arch: [X64, ARM64]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: ${{ matrix.arch == 'ARM64' && 'windows-11-arm' || 'windows-2025' }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
download-pattern: build-${{ matrix.configuration }}-${{ matrix.arch }}
test_mac:
if: ${{ needs.init.outputs.run-mac-tests == 'true' }}
name: call-test-mac
needs: [init, build, prepare_test]
strategy:
fail-fast: false
matrix:
arch: [X64, ARM64]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: ${{ matrix.arch == 'ARM64' && 'macos-26' || 'macos-26-intel' }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
download-pattern: build-${{ matrix.configuration }}-${{ matrix.arch }}
test_qualitygate:
if: ${{ always() }}
name: test-qualitygate
needs: [init, test_linux, test_windows, test_mac]
runs-on: ubuntu-24.04
steps:
- name: Evaluate test results
shell: bash
env:
RUN_MAC_TESTS: ${{ needs.init.outputs.run-mac-tests }}
TEST_LINUX_RESULT: ${{ needs.test_linux.result }}
TEST_WINDOWS_RESULT: ${{ needs.test_windows.result }}
TEST_MAC_RESULT: ${{ needs.test_mac.result }}
run: |
require_success() {
local job_name="$1"
local job_result="$2"
if [[ "$job_result" != "success" ]]; then
echo "::error::$job_name finished with '$job_result'."
exit 1
fi
}
require_success_or_skip() {
local job_name="$1"
local job_enabled="$2"
local job_result="$3"
if [[ "$job_enabled" == "true" ]]; then
require_success "$job_name" "$job_result"
return
fi
if [[ "$job_result" != "success" && "$job_result" != "skipped" ]]; then
echo "::error::$job_name finished with '$job_result' while disabled."
exit 1
fi
}
require_success "test_linux" "$TEST_LINUX_RESULT"
require_success "test_windows" "$TEST_WINDOWS_RESULT"
require_success_or_skip "test_mac" "$RUN_MAC_TESTS" "$TEST_MAC_RESULT"
integration_test:
if: ${{ needs.init.outputs.run-privileged-jobs == 'true' }}
name: ⚗️ Integration Test - Azure and AWS
needs: [init, build]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
configuration: [Release]
project: [ test/**/Savvyio.FunctionalTests.csproj, test/**/Savvyio.Extensions.SimpleQueueService.FunctionalTests.csproj, test/**/Savvyio.Extensions.QueueStorage.FunctionalTests.csproj ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Test with ${{ matrix.configuration }} build
uses: codebeltnet/dotnet-test@v4
with:
projects: ${{ matrix.project }}
configuration: ${{ matrix.configuration }}
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
env:
AWS__CALLERIDENTITY: ${{ secrets.AWS_CALLER_IDENTITY }}
AWS__IAM__ACCESSKEY: ${{ secrets.AWS_IAM_ACCESSKEY }}
AWS__IAM__SECRETKEY: ${{ secrets.AWS_IAM_SECRETKEY }}
AWS__LOCALSTACK: ${{ secrets.AWS_LOCALSTACK }}
AZURE__STORAGE__QUEUECONNECTIONSTRING: ${{ secrets.AZURE_STORAGE_QUEUECONNECTIONSTRING }}
AZURE__NEWTONSOFT__EVENTGRID__WINDOWS__DEBUG__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_WINDOWS_DEBUG_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__WINDOWS__RELEASE__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_WINDOWS_RELEASE_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__LINUX__DEBUG__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_LINUX_DEBUG_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__LINUX__RELEASE__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_LINUX_RELEASE_KEY }}
AZURE__EVENTGRID__WINDOWS__DEBUG__KEY: ${{ secrets.AZURE_EVENTGRID_WINDOWS_DEBUG_KEY }}
AZURE__EVENTGRID__WINDOWS__RELEASE__KEY: ${{ secrets.AZURE_EVENTGRID_WINDOWS_RELEASE_KEY }}
AZURE__EVENTGRID__LINUX__DEBUG__KEY: ${{ secrets.AZURE_EVENTGRID_LINUX_DEBUG_KEY }}
AZURE__EVENTGRID__LINUX__RELEASE__KEY: ${{ secrets.AZURE_EVENTGRID_LINUX_RELEASE_KEY }}
integration_test_rabbitmq:
name: ⚗️ Integration Test - RabbitMQ
needs: [build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Spin up RabbitMQ test dependency
run: |
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:management
- name: Test with Release build
uses: codebeltnet/dotnet-test@v4
with:
projects: test/**/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
- name: Stop RabbitMQ
run: |
docker stop rabbitmq
docker rm rabbitmq
integration_test_nats:
name: ⚗️ Integration Test - NATS
needs: [build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Spin up NATS test dependency
run: |
docker run -d --name nats -p 4222:4222 nats:latest --js
- name: Test with Release build
uses: codebeltnet/dotnet-test@v4
with:
projects: test/**/Savvyio.Extensions.NATS.FunctionalTests.csproj
build-switches: -p:SkipSignAssembly=true
restore: true
build: true # needed for xunitv3
- name: Stop NATS
run: |
docker stop nats
docker rm nats
sonarcloud:
if: ${{ always() && needs.init.outputs.run-privileged-jobs == 'true' && needs.build.result == 'success' && needs.test_qualitygate.result == 'success' && needs.integration_test.result == 'success' && needs.integration_test_rabbitmq.result == 'success' && needs.integration_test_nats.result == 'success' }}
name: call-sonarcloud
needs: [init, build, test_qualitygate, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-sonarcloud/.github/workflows/default.yml@v3
with:
organization: geekle
projectKey: savvyio
version: ${{ needs.build.outputs.version }}
secrets: inherit
codecov:
if: ${{ always() && needs.init.outputs.run-privileged-jobs == 'true' && needs.build.result == 'success' && needs.test_qualitygate.result == 'success' && needs.integration_test.result == 'success' && needs.integration_test_rabbitmq.result == 'success' && needs.integration_test_nats.result == 'success' }}
name: call-codecov
needs: [init, build, test_qualitygate, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-codecov/.github/workflows/default.yml@v1
with:
repository: codebeltnet/savvyio
secrets: inherit
codeql:
if: ${{ always() && needs.init.outputs.run-privileged-jobs == 'true' && needs.build.result == 'success' && needs.test_qualitygate.result == 'success' && needs.integration_test.result == 'success' && needs.integration_test_rabbitmq.result == 'success' && needs.integration_test_nats.result == 'success' }}
name: call-codeql
needs: [init, build, test_qualitygate, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-codeql/.github/workflows/default.yml@v3
permissions:
security-events: write
deploy:
if: github.event_name != 'pull_request'
name: call-nuget
needs: [build, pack, test_qualitygate, integration_test, integration_test_rabbitmq, integration_test_nats, sonarcloud, codecov, codeql]
uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v3
with:
version: ${{ needs.build.outputs.version }}
environment: Production
configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }}
permissions:
contents: write
packages: write
secrets: inherit