Add CodeQL #96
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: CI build | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- '**' # matches every branch | |
- '!master' # excludes master | |
env: | |
Configuration: Release | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
- name: Start RabbitMQ services | |
shell: pwsh | |
run: | | |
docker-compose up -d | |
$val = 0 | |
while(1 -eq 1) { | |
$status_ssl_plain = docker inspect --format "{{json .State.Health.Status }}" serilog.sinks.rabbitmq.ssl-plain | |
$status_ssl_cert = docker inspect --format "{{json .State.Health.Status }}" serilog.sinks.rabbitmq.ssl-cert | |
if ($status_ssl_plain -eq "healthy" -and $status_ssl_cert -eq "healthy") { | |
Write-Host "RabbitMQ services started" | |
break; | |
} | |
$val++ | |
if ($val -ge 20) | |
{ | |
Write-Host "RabbitMQ services not started after 20 attempts" | |
break; | |
} | |
Write-Host "RabbitMQ services status: ssl-plain: $($status_ssl_plain) - ssl-cert: $($status_ssl_cert). Attempt $val. Retry in 1 second" | |
Start-Sleep -s 1 | |
} | |
- name: Setup .NET 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
# Determine new version | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: '5.x' | |
- name: Determine Version | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0 | |
with: | |
useConfigFile: true | |
configFilePath: gitversion.yml | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c ${{ env.Configuration }} /p:Version=${{ steps.gitversion.outputs.FullSemVer }} | |
- name: Run tests | |
run: dotnet test --no-build -c ${{ env.Configuration }} -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=out/.coverage/ | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: out/.coverage/*.opencover.xml | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
- name: Create nuget packages | |
run: dotnet pack --no-build -c ${{ env.Configuration }} -o dist/packages /p:PackageVersion=${{ steps.gitversion.outputs.FullSemVer }} |