Skip to content

V4.0.0/prepare for launch #27

V4.0.0/prepare for launch

V4.0.0/prepare for launch #27

Workflow file for this run

name: Savvyi I/O Pipeline
on:
pull_request:
branches: [main]
paths-ignore:
- .codecov/**
- .docfx/**
- .github/**
- .nuget/**
- '**.md'
workflow_dispatch:
inputs:
configuration:
type: choice
description: The build configuration to use in the deploy stage.
required: true
default: Release
options:
- Debug
- Release
jobs:
prepare:
name: 🧰 Prepare
runs-on: ubuntu-22.04
outputs:
testProjects: ${{ 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@v1
with:
pattern: test/**/*.csproj
build:
name: 🛠️ Build
runs-on: ubuntu-22.04
strategy:
matrix:
configuration: [Debug, Release]
framework: [net9.0, net8.0]
outputs:
version: ${{ steps.minver-calculate.outputs.version }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v1
with:
includePreview: true
- name: Install MinVer
uses: codebeltnet/dotnet-tool-install-minver@v1
- id: minver-calculate
name: Calculate Version
uses: codebeltnet/minver-calculate@v2
- name: Download savvyio.snk file
uses: codebeltnet/gcp-download-file@v1
with:
serviceAccountKey: ${{ secrets.GCP_TOKEN }}
bucketName: ${{ secrets.GCP_BUCKETNAME }}
objectName: savvyio.snk
- name: Restore Dependencies
uses: codebeltnet/dotnet-restore@v2
- name: Build for ${{ matrix.framework }} (${{ matrix.configuration }})
uses: codebeltnet/dotnet-build@v2
with:
configuration: ${{ matrix.configuration }}
framework: ${{ matrix.framework }}
pack:
name: 📦 Pack
runs-on: ubuntu-22.04
strategy:
matrix:
configuration: [Debug, Release]
needs: [build]
steps:
- name: Install .NET
uses: codebeltnet/install-dotnet@v1
with:
includePreview: true
- name: Pack for ${{ matrix.configuration }}
uses: codebeltnet/dotnet-pack@v2
with:
configuration: ${{ matrix.configuration }}
uploadPackedArtifact: true
version: ${{ needs.build.outputs.version }}
test:
name: 🧪 Test
needs: [prepare, build]
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare.outputs.testProjects) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v1
with:
includePreview: true
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Test with ${{ matrix.configuration }} build
uses: codebeltnet/dotnet-test@v3
with:
projects: ${{ matrix.project }}
configuration: ${{ matrix.configuration }}
buildSwitches: -p:SkipSignAssembly=true
level: normal
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 }}
sonarcloud:
name: 🔬 Code Quality Analysis
needs: [build,test]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v1
with:
includePreview: true
- name: Install .NET Tool - Sonar Scanner
uses: codebeltnet/dotnet-tool-install-sonarscanner@v1
- name: Restore Dependencies
uses: codebeltnet/dotnet-restore@v2
- name: Run SonarCloud Analysis
uses: codebeltnet/sonarcloud-scan@v1
with:
token: ${{ secrets.SONAR_TOKEN }}
organization: geekle
projectKey: savvyio
version: ${{ needs.build.outputs.version }}
- name: Build
uses: codebeltnet/dotnet-build@v2
with:
buildSwitches: -p:SkipSignAssembly=true
uploadBuildArtifact: false
- name: Finalize SonarCloud Analysis
uses: codebeltnet/sonarcloud-scan-finalize@v1
with:
token: ${{ secrets.SONAR_TOKEN }}
codecov:
name: 📊 Code Coverage Analysis
needs: [build,test]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Run CodeCov Analysis
uses: codebeltnet/codecov-scan@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
repository: codebeltnet/savvyio
codeql:
name: 🛡️ Security Analysis
needs: [build,test]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v1
with:
includePreview: true
- name: Restore Dependencies
uses: codebeltnet/dotnet-restore@v2
- name: Prepare CodeQL SAST Analysis
uses: codebeltnet/codeql-scan@v1
- name: Build
uses: codebeltnet/dotnet-build@v2
with:
buildSwitches: -p:SkipSignAssembly=true
uploadBuildArtifact: false
- name: Finalize CodeQL SAST Analysis
uses: codebeltnet/codeql-scan-finalize@v1
deploy:
if: github.event_name != 'pull_request'
name: 🚀 Deploy v${{ needs.build.outputs.version }}
runs-on: ubuntu-22.04
needs: [build,pack,test,sonarcloud,codecov,codeql]
environment: Production
steps:
- uses: codebeltnet/nuget-push@v1
with:
token: ${{ secrets.NUGET_TOKEN }}
configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }}