From 1009f6e97e9b99f9b16d2d96952a94d79c1f2ccc Mon Sep 17 00:00:00 2001 From: David Justo Date: Tue, 18 Jun 2024 22:20:49 -0700 Subject: [PATCH] add analyzer tests and worker extension tests --- .github/workflows/validate-build-analyzer.yml | 59 +++++++++++++++++++ .github/workflows/validate-build.yml | 3 + 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/validate-build-analyzer.yml diff --git a/.github/workflows/validate-build-analyzer.yml b/.github/workflows/validate-build-analyzer.yml new file mode 100644 index 000000000..7c98ceda5 --- /dev/null +++ b/.github/workflows/validate-build-analyzer.yml @@ -0,0 +1,59 @@ +name: Validate Build (analyzer) + +on: + push: + branches: + - main + - dajusto/run-tests-in-gh-action + paths-ignore: [ '**.md' ] + pull_request: + branches: + - main + paths-ignore: [ '**.md' ] + +env: + solution: WebJobs.Extensions.DurableTask.sln + config: Release + AzureWebJobsStorage: UseDevelopmentStorage=true + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + + - name: Set up .NET Core 3.1 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '3.1.x' + + - name: Set up .NET Core 2.1 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '2.1.x' + + - name: Restore dependencies + run: dotnet restore $solution + + - name: Build + run: dotnet build $solution #--configuration $config #--no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true + + # Install Azurite + - name: Set up Node.js (needed for Azurite) + uses: actions/setup-node@v3 + with: + node-version: '18.x' # Azurite requires at least Node 18 + + - name: Install Azurite + run: npm install -g azurite + + # Run tests + - name: Run Analyzer tests + run: azurite --silent --blobPort 10000 --queuePort 10001 --tablePort 10002 & dotnet test ./test/WebJobs.Extensions.DurableTask.Analyzers.Test/WebJobs.Extensions.DurableTask.Analyzers.Test.csproj + diff --git a/.github/workflows/validate-build.yml b/.github/workflows/validate-build.yml index 4587d7006..33e4cba05 100644 --- a/.github/workflows/validate-build.yml +++ b/.github/workflows/validate-build.yml @@ -57,3 +57,6 @@ jobs: - name: Run FunctionsV2 tests (except E2E tests) run: azurite --silent --blobPort 10000 --queuePort 10001 --tablePort 10002 & dotnet test ./test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj --filter "FullyQualifiedName!~Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests.DurableTaskEndToEndTests" + - name: Run Worker Extension tests + run: azurite --silent --blobPort 10000 --queuePort 10001 --tablePort 10002 & dotnet test ./test/Worker.Extensions.DurableTask.Tests/Worker.Extensions.DurableTask.Tests.csproj +