Enable Prereleases #124
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: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | ||
run: | | ||
dotnet test 'tests\Ephemerally.Tests\' ` | ||
--no-build ` | ||
--configuration:Release ` | ||
--logger:trx ` | ||
--results-directory ${{ env.ArtifactDirectory }} | ||
- name: Test Redis | ||
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }} | ||
run: | | ||
dotnet test 'tests\Ephemerally.Redis.Tests\' ` | ||
--no-build ` | ||
--configuration:Release ` | ||
--logger:trx ` | ||
--results-directory ${{ env.ArtifactDirectory }} | ||
- name: Upload Test Results | ||
if: ${{ 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: | ||
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\Ephemerally.Azure.Cosmos.Tests\' ` | ||
--no-build ` | ||
--configuration:Release ` | ||
--logger:trx ` | ||
--results-directory ${{ env.ArtifactDirectory }} | ||
- name: Upload Test Results | ||
if: ${{ 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: | ||
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 | ||
if: always() | ||
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 | ||
release: | ||
needs: | ||
- tag | ||
- build_and_test | ||
- build_and_test_cosmos | ||
if: ${{ github.event_name != 'pull_request' && needs.tag.outputs.prerelease-depth < 2 }} | ||
uses: ./.github/workflows/release.yml | ||
Check failure on line 169 in .github/workflows/build_and_test.yml GitHub Actions / Build, Test, ReleaseInvalid workflow file
|
||
with: | ||
version: ${{ needs.tag.outputs.version }} | ||
secrets: inherit |