don't require setting id on supplied cosmos container properties #93
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: Build & Test | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
branches: | |
- 'main' | |
- 'gh-actions*' | |
pull_request: | |
branches: | |
- '*' | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
ArtifactDirectory: ${{ github.workspace}}/artifacts | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
# Cosmos DB Emulator is broken on Ubuntu | |
# https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/56 | |
build_and_test: | |
runs-on: windows-2022 | |
permissions: | |
checks: write | |
pull-requests: write | |
# Reenable when Ubuntu is fixed | |
# services: | |
# cosmos: | |
# image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator | |
# ports: | |
# - 8081:8081 | |
# - 10250-10255:10250-10255 | |
# env: | |
# AZURE_COSMOS_EMULATOR_PARTITION_COUNT: 3 | |
# AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE: true | |
steps: | |
- uses: actions/checkout@v2 | |
# Remove when Ubuntu is fixed | |
- name: Start Cosmos DB Emulator | |
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
uses: southpolesteve/cosmos-emulator-github-action@v1 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6 | |
dotnet-quality: ga | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
# Reenable when Ubuntu is fixed | |
# - name: Wait for Cosmos Emulator | |
# uses: cygnetdigital/[email protected] | |
# with: | |
# url: 'https://localhost:8081/_explorer/index.html' | |
# responseCode: '200,500' | |
# timeout: 5000 | |
# interval: 500 | |
- name: Test | |
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
run: dotnet test --no-build --verbosity normal --logger:trx --results-directory ${{ env.ArtifactDirectory }} | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
if: always() | |
with: | |
files: | | |
${{ env.ArtifactDirectory }}/**/*.trx | |
tag: | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: ./.github/workflows/tag.yml | |
release: | |
needs: | |
- tag | |
- build_and_test | |
if: ${{ github.event_name != 'pull_request' && needs.tag.outputs.prerelease-depth < 2 }} | |
uses: ./.github/workflows/release.yml | |
with: | |
version: ${{ needs.tag.outputs.version }} | |
secrets: inherit |