Skip to content

Added github workflows. #42

Added github workflows.

Added github workflows. #42

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
BUILD_CONFIGURATION: Release
jobs:
build-test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: |
global.json
Directory.Packages.props
**/*.csproj
- name: Restore
run: dotnet restore CosmosDBShell.sln --configfile .github/nuget.github.config
- name: Build solution
run: dotnet build CosmosDBShell.sln --configuration $env:BUILD_CONFIGURATION --no-restore
shell: pwsh
- name: Test solution
run: >-
dotnet test CosmosDBShell.sln
--configuration $env:BUILD_CONFIGURATION
--no-build
--no-restore
--logger "trx;LogFileName=test-results.trx"
--results-directory TestResults
--collect "Code coverage"
shell: pwsh
- name: Run fuzzer smoke test
working-directory: CosmosDBShell.Fuzzer
run: dotnet run --configuration $env:BUILD_CONFIGURATION --no-build --no-restore -- --all
shell: pwsh
- name: Fail if fuzzer crash findings exist
shell: pwsh
run: |
$crashes = Get-ChildItem -Path CosmosDBShell.Fuzzer/findings -Filter 'crash_*.txt' -ErrorAction SilentlyContinue
if ($crashes -and $crashes.Count -gt 0) {
Write-Error "Fuzzer recorded $($crashes.Count) crash(es). See the 'fuzz-findings' artifact for details."
exit 1
}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults
if-no-files-found: ignore
- name: Upload fuzzer findings
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-findings
path: CosmosDBShell.Fuzzer/findings
if-no-files-found: ignore