Hashset #6
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, Release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
branches: | |
- 'main' | |
- 'gh-actions*' | |
pull_request: | |
branches: | |
- '*' | |
env: | |
TIMEZONE: 'America/Chicago' | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
ArtifactDirectory: ${{ github.workspace}}/artifacts | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8 | |
dotnet-quality: ga | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration:Release | |
- name: Test Core | |
if: ${{ always() && github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
run: | | |
dotnet test 'tests\Distributed.Collections.Tests\' ` | |
--no-build ` | |
--configuration:Release ` | |
--logger:trx ` | |
--results-directory ${{ env.ArtifactDirectory }} | |
- name: Test Redis | |
if: ${{ always() && github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
run: | | |
dotnet test 'tests\Distributed.Collections.Redis.Tests\' ` | |
--no-build ` | |
--configuration:Release ` | |
--logger:trx ` | |
--results-directory ${{ env.ArtifactDirectory }} | |
- name: Upload Test Results | |
if: ${{ always() && github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: ${{ env.ArtifactDirectory }}/**/*.trx | |
# Cosmos DB Emulator is broken on Ubuntu | |
# https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/56 | |
build_and_test_cosmos: | |
if: false | |
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: 8 | |
dotnet-quality: ga | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration:Release | |
# 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 Cosmos | |
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
run: | | |
dotnet test 'tests\Distributed.Collections.Azure.Cosmos.Tests\' ` | |
--no-build ` | |
--configuration:Release ` | |
--logger:trx ` | |
--results-directory ${{ env.ArtifactDirectory }} | |
- name: Upload Test Results | |
if: ${{ always() && github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cosmos-test-results | |
path: ${{ env.ArtifactDirectory }}/**/*.trx | |
test_results_comment: | |
if: ${{ always() && github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
needs: | |
- build_and_test | |
#- build_and_test_cosmos | |
steps: | |
- name: Download Test Results | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.ArtifactDirectory }} | |
- name: Test Results Comment | |
uses: im-open/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
timezone: ${{ env.TIMEZONE }} | |
create-status-check: false | |
create-pr-comment: true | |
comment-identifier: 'TestResults' | |
tag: | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: ./.github/workflows/tag.yml | |
test-tag-output: | |
runs-on: ubuntu-latest | |
needs: | |
- tag | |
steps: | |
- name: Echo tag output | |
run: | | |
echo version: "${{ needs.tag.outputs.version }}" | |
echo prerelease-depth: "${{ fromJSON(needs.tag.outputs.prerelease-depth) }}" | |
echo is-prerelease: "${{ fromJSON(needs.tag.outputs.is-prerelease) }}" | |
release: | |
needs: | |
- tag | |
- build_and_test | |
#- build_and_test_cosmos | |
if: ${{ github.ref_type == 'tag' || github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && fromJSON(needs.tag.outputs.prerelease-depth) < 2 }} | |
uses: ./.github/workflows/release.yml | |
with: | |
version: ${{ needs.tag.outputs.version }} | |
is-prerelease: ${{ fromJSON(needs.tag.outputs.is-prerelease) }} | |
secrets: inherit |