Skip to content

Rename CosmosNoSql provider to AzureCosmosDB #121

Rename CosmosNoSql provider to AzureCosmosDB

Rename CosmosNoSql provider to AzureCosmosDB #121

Workflow file for this run

name: MEVD
on:
push:
branches: [main]
tags:
- "mevd/v*" # All providers: mevd/v1.0.0-preview.1
- "mevd/*/v*" # Single provider: mevd/PgVector/v1.0.0-preview.1
paths:
- 'MEVD/**'
- 'Shared/**'
- 'eng/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
- 'global.json'
- 'nuget.config'
- '.github/workflows/mevd.yml'
pull_request:
branches:
- main
- copilot/*
paths:
- 'MEVD/**'
- 'Shared/**'
- 'eng/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
- 'global.json'
- 'nuget.config'
- '.github/workflows/mevd.yml'
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
discover:
name: Discover providers
runs-on: ubuntu-latest
outputs:
all_providers: ${{ steps.scan.outputs.all_providers }}
# Release-specific outputs (only meaningful on tag pushes)
is_release: ${{ steps.tag.outputs.is_release }}
version: ${{ steps.tag.outputs.version }}
pack_target: ${{ steps.tag.outputs.pack_target }}
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: MEVD/src
sparse-checkout-cone-mode: false
- name: Scan provider directories
id: scan
run: |
# All providers from src (excluding Shared)
all=$(ls -d MEVD/src/*/ | xargs -I{} basename {} | grep -v '^Shared$' | jq -R . | jq -sc .)
echo "all_providers=$all" >> $GITHUB_OUTPUT
- name: Parse release tag
id: tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "is_release=true" >> $GITHUB_OUTPUT
tag="${GITHUB_REF_NAME}"
# Strip leading "mevd/" prefix
rest="${tag#mevd/}"
if [[ "$rest" == v* ]]; then
# All providers: mevd/v1.0.0-preview.1
version="${rest#v}"
echo "pack_target=MEVD/MEVD.slnf" >> $GITHUB_OUTPUT
else
# Single provider: mevd/PgVector/v1.0.0-preview.1
provider="${rest%%/v*}"
version="${rest#*/v}"
echo "pack_target=MEVD/src/$provider/$provider.csproj" >> $GITHUB_OUTPUT
fi
echo "version=$version" >> $GITHUB_OUTPUT
echo "Parsed tag '$tag' → version='$version'"
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: nuget-
- name: Build
run: dotnet build MEVD/MEVD.slnf
unit-tests:
name: 'Unit Tests (${{ matrix.os }})'
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: nuget-
- name: Test
shell: bash
run: |
rc=0
count=0
for src in MEVD/src/*/; do
provider="$(basename "$src")"
[[ "$provider" == "Shared" ]] && continue
testDir="MEVD/test/${provider}.UnitTests"
if [[ -d "$testDir" ]]; then
count=$((count + 1))
dotnet test "$testDir" || rc=1
else
echo "Missing unit tests directory: $testDir" >&2
rc=1
fi
done
if [[ $count -eq 0 ]]; then
echo "No unit test projects found." >&2
rc=1
fi
exit $rc
# Conformance tests run on Ubuntu only: most providers use Testcontainers with Linux Docker
# images, which aren't available on Windows GitHub-hosted runners.
conformance-tests:
name: 'Conformance: ${{ matrix.provider }}'
needs: [discover, build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
provider: ${{ fromJson(needs.discover.outputs.all_providers) }}
# AzureAISearch requires a cloud instance and can't run in CI.
exclude:
- provider: AzureAISearch
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: nuget-
- name: Test
run: dotnet test MEVD/test/${{ matrix.provider }}.ConformanceTests
# --- Release pipeline (only on tag pushes) ---
package:
name: Package
if: startsWith(github.ref, 'refs/tags/')
needs: [discover, unit-tests, conformance-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: nuget-
- name: Pack NuGet packages
run: >
dotnet pack ${{ needs.discover.outputs.pack_target }}
-c Release
-o ./nuget
-p:PackageVersion=${{ needs.discover.outputs.version }}
-p:CI=true
- name: Upload NuGet packages as artifacts
uses: actions/upload-artifact@v6
with:
name: nuget-packages
if-no-files-found: error
path: ./nuget
- name: List NuGet packages in step summary
run: |
echo "## NuGet packages:" >> $GITHUB_STEP_SUMMARY
find nuget -type f -name '*.nupkg' -exec basename {} \; >> $GITHUB_STEP_SUMMARY
- name: Upload signing file list
uses: actions/upload-artifact@v6
with:
name: nuget-list
if-no-files-found: error
path: ${{ github.workspace }}/.github/workflows/SignClientFileList.txt
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: package
uses: ./.github/workflows/release.yml
secrets: inherit